Bug or feature?

James C. Ahlstrom jim at interet.com
Fri May 14 11:19:23 EDT 1999


Michael Hudson wrote:
> 
> [ Speaking if class data attributes]
> I have never used this technique. I don't think I've ever seen code
> that does. Module-level globals are (IMHO) generally clearer. For a
> start, if you want mutable data, you more-or-less have to wrap it up
> in a list, and that's confusing.

FWIW, I constantly use class data attributes.  It is the natural way
to specify things that are properties of the class and can't vary with
the instance.

The simple answer is to use __init__() to specify things that _can_
vary with the instance.

Jim Ahlstrom




More information about the Python-list mailing list