Created
December 27, 2025 06:33
-
-
Save mypy-play/2e1728d4059bf595164ca3549e1a9824 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains hidden or 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 A: | |
| import math | |
| def __new__(cls) -> "A": | |
| reveal_type(cls.math.pi) # N: Revealed type is "Any" | |
| return cls() | |
| def pos_or_named_self(self) -> None: | |
| reveal_type(self.math.pi) # N: Revealed type is "builtins.float" | |
| def pos_only_self(self, /) -> None: | |
| reveal_type(self.math.pi) # N: Revealed type is "Any" | |
| @classmethod | |
| def clsmethod(cls) -> None: | |
| reveal_type(cls.math.pi) # N: Revealed type is "builtins.float" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment