You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to get circular dependencies in python the normal way to resolve this is to take the circular dependent items into another file. However now with typing it is possible to get circular references only through typing it is possible to resolve this by:
Instead of the type use the text version of the type
Import the type using:
if TYPE_CHECKING:
from XXX import XXXX
For example:
from x import ArgType
def myfun(arg: ArgType):
replace with:
if TYPE_CHECKING:
from x import ArgType
def myfun(arg: 'ArgType'):