Last active
June 12, 2026 08:44
-
-
Save rix0rrr/0e713c5fd1d7f20122a40313b0f4f85a to your computer and use it in GitHub Desktop.
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
| import one | |
| import two | |
| print(one.stub_types()) | |
| print(two.stub_types()) | |
| # Prints | |
| # {'x': <class 'one.Homonymous'>} | |
| # {'x': <class 'two.Homonymous'>} |
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
| import typing | |
| class Homonymous: | |
| def __repr__(self): | |
| return 'one.Homonymous' | |
| def stub(x: 'Homonymous'): | |
| pass | |
| def stub_types(): | |
| return typing.get_type_hints(stub) |
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
| import typing | |
| class Homonymous: | |
| def __repr__(self): | |
| return 'two.Homonymous' | |
| def stub(x: 'Homonymous'): | |
| pass | |
| def stub_types(): | |
| return typing.get_type_hints(stub) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment