Mar-02-2017, 05:06 AM
(Mar-02-2017, 04:29 AM)Skaperen Wrote: you cannot add a new attribute using the first form, except for methods.What are you going on about?
>>> class Blank: ... pass ... >>> a = Blank() >>> a <__main__.Blank instance at 0x02B12760> >>> a.foo Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: Blank instance has no attribute 'foo' >>> a.foo = 5 >>> a.foo 5 >>>