> If the type is a class with methods, then this method doesn't work
Use typing.Self
Use typing.Self
class Foo:
def __init__(self, bar):
self.bar = bar
class Bar:
def __init__(self, foo):
self.foo = foo
Obviously both called into each other to do $THINGS... Pure madness.So my suggestion: Try not to have interdependent classes :D
Maybe I am just a bit burned by this particular example I ran into (where this pattern should IMO not have been used).