class variables

Andre Meyer meyer at acm.org
Thu Jul 27 17:17:41 EDT 2006


Hi all

I am trying to understand the magic of Python's class variables and tried
the following code (see below).

Just out of curiosity, I tried to define a property that provides access to
a seemingly instancae variable which is in fact a class variable. All seems
to work fine (case 4), but when a custom object is assigned, an instance
variable is created instead of using theproerty (case 5).

What goes wrong here? What is the difference between cases 4 and 5? How can
case 5 be fixed?

thanks a lot for your help
Andre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060727/239b2af0/attachment.html>


More information about the Python-list mailing list