Как получить доступ к «myvar» из «дочернего» кода в этом примере кода:
class Parent():
def __init__(self):
self.myvar = 1
class Child(Parent):
def __init__(self):
Parent.__init__(self)
# this won't work
Parent.myvar
child = Child()
Подробнее здесь: https://stackoverflow.com/questions/109 ... s-instance
Мобильная версия