Как расширить класс Python init
Я создал базовый класс:
class Thing():
def __init__(self, name):
self.name = name
Я хочу расширить класс и добавить вв этом метод, так чтоSubThing
имеет какname
иtime
имущество. Как мне это сделать?
class SubThing(Thing):
# something here to extend the init and add a "time" property
def __repr__(self):
return '' % (self.name, self.time)
Любая помощь будет потрясающей.