[Tutor] Problems with references
glingl at aon.at
Wed Jun 2 20:51:47 EDT 2004
> This leads back to what it was that i origanally objected in one of
> your e-mails, that the idea of attributes is that they should be shared.
Do you agree, that there are two kinds of attributes in Python: instance
attributes and class attributes?
The latter are not shared beween objects (instances) of the same class,
whereas the former are.
What do you think, that "class attributes are for"? And keep in mind:
you need not use them,
if you don't like them ;-)
> "If the dictionary is defined as a class attribute it will be
> shared across instances. That is what class attributes are for."
> Hope my writing clears any misunderstandings in my position. :)
> Martin Eriksen
> Tutor maillist - Tutor at python.org
More information about the Tutor