0

I'm making two classes that have this structure:

class Container(object):
    def get_element(self) -> Element:
        return Element(self)

class Element(object):
    def __init__(self, owner: Container):
        self.owner = owner

I'm currently putting both classes in the same file because it makes more sense in my current project (the example is not the actual code but it describes the problem) but the first declared one will not see the second one.

I could just set one of them as Any but I really want to get that intellisense, I'm making a lib that chain methods and without the intellisense the developer experience is terrible.

Ivan Lo Greco
  • 315
  • 1
  • 9

0 Answers0