INHERITANCE in python3
vahid asadi
zidan.roony at yahoo.com
Wed Dec 18 23:10:00 EST 2019
HI guys this is my first post on python mailing lists ever and i glad to do this.
my problem here is why this attribute is not recognize by python and it raise an traceback error that said 'there is no such p.family attribute'. although i use multiple inheritance with 'super ' it not works. thanks for your help.
``` class Username: def __init__(self,name,*args): self.name = name
class Userfamily: def __init__(self,family,*args): self.family = family
class Person(Username,Userfamily): def __init__(self,*args): super().__init__(*args)
p = Person("v","aaa")print(p.name)print(p.family)```
More information about the Python-list
mailing list