O'Reilly logo
  • You Wang thinks this is interesting:

Inside a method (which is just a function whose first argument is the instance on which it is called to operate), several kinds of variables are potentially accessible. The object’s instance variables can be accessed by qualifying their name with the instance itself. Local variables can be created inside the method; these are accessed without qualification. Class variables (sometimes called static variables) can be accessed by qualifying their name with the class name, and global variables, that is, module variables, are accessed without qualification.

From

Cover of Programming in Python 3: A Complete Introduction to the Python Language, Second Edition

Note

attributes defined in init run each time object created, attributes defined in class only run once