-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: information around struct base classes is lost #473
Labels
bug
This issue is a bug.
closed-for-staleness
effort/large
Large work item – several weeks of effort
language/python
Related to Python bindings
p2
Comments
rix0rrr
added
bug
This issue is a bug.
language/python
Related to Python bindings
p0
labels
Apr 19, 2019
rix0rrr
pushed a commit
that referenced
this issue
Apr 23, 2019
Because structs all inherit from TypedDict, and TypedDict erases the inheritance chain of structs, we have to maintain a copy of the inheritance hierarchy on the class objects, for later use during doc generation. This addresses (part of) #473.
rix0rrr
added a commit
that referenced
this issue
Apr 23, 2019
Because structs all inherit from TypedDict, and TypedDict erases the inheritance chain of structs, we have to maintain a copy of the inheritance hierarchy on the class objects, for later use during doc generation. This addresses (part of) #473.
The way I've fixed this now is actually not great, because it's not going to be useful to IDEs. We should just generate a complete "Attributes" block in the class docstring instead. This can be done later. |
This issue has not received any attention in 2 years. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
github-actions
bot
added
closing-soon
This issue will automatically close in 4 days unless further comments are made.
closed-for-staleness
and removed
closing-soon
This issue will automatically close in 4 days unless further comments are made.
labels
Jun 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
This issue is a bug.
closed-for-staleness
effort/large
Large work item – several weeks of effort
language/python
Related to Python bindings
p2
Structs are implemented in Python using
mypy_extensions.TypedDict
.Unfortunately, this class uses a metaclass that completely destroys class inheritance information:
The
__annotations__
contain all annotations from base classes, but thegetmro()
returns:Even though the actual declaration of
DerivedStruct
looks like this:So we are missing the bases
_DerivedStruct
andMyFirstStruct
(and everything above).Without these bases, we can't generate docs for those members.
The text was updated successfully, but these errors were encountered: