Class attribute or instance attribute?

Asun Friere afriere at
Tue Apr 29 06:50:41 CEST 2003

mis6 at (Michele Simionato) wrote in message news:<2259b0e2.0304281329.12ac184b at>...
> "Paul Watson" <pwatson at> wrote in message news:<vaqtlsqbi52j93 at>...
> > When is an attribute a class attribute or an instance attribute?
> I give you a subtle example:
On the other hand here is a totally obvious example illustrating the same ;-)

class Foo (object) :
    foo = 'spam'
    def __init__ (self) :
        print, = 'ham'

>>> f = Foo()
spam spam
spam ham
>>> print,
ham spam

More information about the Python-list mailing list