Last active
December 4, 2021 04:36
-
-
Save SyntaxColoring/ad2e66aed50a3c9e0c721ba8098a0908 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo: | |
bar: int | |
reveal_type(Foo().bar) # OK, builtins.int | |
reveal_type(Foo.bar) # mypy says builtins.int, | |
# but I expected this to be an error. | |
print(Foo.bar) # Passes type-checking and raises AttributeError at runtime. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment