The problem is that in the following situation, autocompletion in the SubFoo class does not work in Pylance. Pylance only recognize the methods and attributes of the Bar class inside SubFoo class, but not the methods and attributes of the SubBar class. Am I doing the right thing?
class Bar:
def method1(self):
# do stuff
class SubBar(Bar):
def method2(self):
# do stuff
class Foo:
def __init__(self, arg: Bar):
self.attr: Bar = arg
def do_a(self):
self.attr.method1()
class SubFoo(Foo):
def __init__(self, arg: SubBar):
super().__init__(arg)
def do_b(self):
self.attr.method1() # Pylance's autocopmletion recognizes method1()
self.attr.method2() # Pylance's autocopmletion doesn't recognize method2()