Day when you lost your #Python typing innocence:
from typing import TYPE_CHECKING
# Always False in runtime but IDE and mypy will understand
if TYPE_CHECKING:
from cycle_reference_module import CycleReferencedType
....
def foo(): -> 'CycleReferencedType'
...
-
-
Ideally, you shouldn't, but I was referring to this: https://twitter.com/dabeaz/status/1049986505052184577 … Just look at this glorious hack, isn't it cool!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.