December 2000
Intermediate to advanced
816 pages
16h 57m
English
Instances have only data attributes (methods are strictly class attributes) and are simply data values which you want to be associated with a particular instance of any class and are accessible via the familiar dotted-attribute notation. These values are independent of any other instance or of the class it was instantiated from. When an instance is deallocated, so are its attributes.
Instance attributes can be set any time after an instance has been created, in any piece of code that has access to the instance. However, one of the key places where such attributes are set is in the constructor, __init__().
Read now
Unlock full access