O'Reilly logo
  • Chris Kang thinks this is interesting:

Your program is usually more readable if you bind, and thus create, class attributes only with statements inside the class body. However, rebinding them elsewhere may be necessary if you want to carry state information at a class, rather than instance, level; Python lets you do that, if you wish. There is no difference between a class attribute created in the class body, and one created or rebound outside the body by assigning to an attribute.


Cover of Python in a Nutshell, 3rd Edition


You can define a member (static) to a class outside the class definition.