Bug or feature?
Jeremy Hylton
jeremy at cnri.reston.va.us
Fri May 14 16:43:33 EDT 1999
>>>>> "CT" == Christian Tismer <tismer at appliedbiometrics.com> writes:
CT> Fredrik Lundh wrote: ...
>> could anyone tell me which beginner's document that says that
>> Python has class variables, and that using them is a good idea?
>> especially for mutable data types?
>> From the standard tutorial which I think is addressed to
CT> beginners, we find
CT> GvR_says=""" 9.3.2 Class Objects
[...]
CT> """
CT> I think this is not an invitation and not a warning. Althpough
CT> I cannot find anything wrong with class variables if one knows
CT> what she does.
I agree! The tutorial could do more to encourage good style with its
initial example.
I just read through Chapter 9 ("Classes") of the tutorial early today,
and it could use some work. It has two long rambly sections titled
"Python Scopes and Name Spaces" and "Random Remarks." Each has a
number of important things to say, but I doubt many people are going
to catch them on the first (or second) reading. Interestingly enough,
the first section of Chapter 9 ("A Word on Terminology") also
discusses Python gotcha #3 -- shared mutable objects.
Perhaps we should contribute some revisions to this chapter.
Jeremy
More information about the Python-list
mailing list