Created
November 6, 2018 06:43
-
-
Save shinh/162f9db7aa300d68fd29ad92f51e7810 to your computer and use it in GitHub Desktop.
mypy with cyclic dep
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 u | |
print(u.U().foo()) |
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 v | |
# class U(object): | |
# def foo(self) -> 'U': | |
# return v.V().bar(self) | |
from v import V | |
class U(object): | |
def foo(self) -> 'U': | |
return V().bar(self) |
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 u | |
# class V(object): | |
# def bar(self, x) -> 'u.U': | |
# return x | |
# from u import U | |
class V(object): | |
def bar(self, x) -> 'U': | |
return x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment