We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Wouldn't it be better if the type of self.class was the current class?
`class Class(object): attr = None
def __init__(self): # type: () -> None reveal_type(self.__class__) print(self.__class__.attr)
`
This way, the revealed type is: Revealed type is 'builtins.type'
If I remove the # type annotation, the revealed type is: Revealed type is 'Any'
The text was updated successfully, but these errors were encountered:
See python/typeshed#1549, which we'll hopefully reapply at some point.
Sorry, something went wrong.
Also, the Any result is because without the annotation it's an untyped function. Newer mypy versions earn about reveal_type() in that context.
No branches or pull requests
Wouldn't it be better if the type of self.class was the current class?
`class Class(object):
attr = None
`
This way, the revealed type is:
Revealed type is 'builtins.type'
If I remove the # type annotation, the revealed type is:
Revealed type is 'Any'
The text was updated successfully, but these errors were encountered: