-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Error when accessing attribute of inner class #3635
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
Comments
Interesting. This will pass typechecking:
So the issue seems to be that B is being inferred as a function. |
@ethanhs yeah debugging that now. The issue is when analyzing the member access the type is |
Yep, that makes sense. Shouldn't be too bad to fix if you add handling of member classes. |
rowillia
pushed a commit
to rowillia/mypy
that referenced
this issue
Jun 29, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
test_inner_class_attribute.py:
Python executes the code just fine:
But mypy fails to typecheck
$ mypy test_inner_class_attribute.py test_inner_class_attribute.py:5: error: Member "Meta" is not assignable
This pattern is super common in the Django Rest Framework, Marshmallow, and PynamoDB projects (Probably more that I don't know about as well 😄 )
The text was updated successfully, but these errors were encountered: