This is the python code that causes me problems : # -*- coding: utf-8 -*- class ObjectType2 (object): def __init__ (self): self.name = '' self.value2 = 0 cl
Solution 1:
The
def__init(self):
should be
def__init__(self):
↑↑
Without the two trailing underscores this is just a method like any other, not a constructor.
Share
Post a Comment
for "Python : Can't Solve Attributeerror - Object Has No Attribute Xxx"
Post a Comment for "Python : Can't Solve Attributeerror - Object Has No Attribute Xxx"