|
|
|
|
|
by daniel_rh
1397 days ago
|
|
This article mentions the woes of circular imports.
I thought MyPy let you work around that by doing if False: around your imports eg
a.py:
import c if False:
import b
class X:
def x(self):
#type: () -> b.Y
from b import something_that_returns_y
return something_that_returns_y(self)
b.py: from a import X
class Y:
pass
def something_that_returns_y(x : X) -> Y:
return Y()
per https://github.com/asottile/flake8-typing-imports |
|