When inheriting a type variable defined as Generic, how can I write documentation with the concretized type variable? #308
Replies: 3 comments 8 replies
-
Could you elaborate on what you're trying to achieve with code examples? I'm not sure to understand. I also wasn't able to understand what your code is doing by quickly looking at it. If you modify the signature in-place, it should also impact how the docstring is parsed, and therefore what the parameters section displays. Maybe it doesn't because you're copying objects instead of modifying them in-place? |
Beta Was this translation helpful? Give feedback.
-
@jonghwanhyeon I see you closed the discussion. Have you resolved your issue? Could you tell us how? |
Beta Was this translation helpful? Give feedback.
-
I solved the problem by using function =deepcopy(member, memo={id(member.parent): member.parent}) |
Beta Was this translation helpful? Give feedback.
-
Based on what I’ve found, unless the child class explicitly defines the type annotation, the type will be represented by the type variable defined as Generic.
To address this, I wrote an Extension, but I found that it applies to the Signature section and not to the Parameters section.
Is there a part I missed in the Extension I wrote, or is there an easier way to solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions