On 09/11/05, Roy Bleasdale <[EMAIL PROTECTED]> wrote:
> I have created a List within a class. If I try and append to the list using
> the set function using the property value my variable stops being a list.
>
> Can anyone explain why the set function called by the class property does
> not append to the list?
>
>
> Here is some sample code:
>
> class ShoppingBag:

Properties only work properly with new style classes.  You get a new
style class by inheriting from another new style class, or by
inheriting from object.

Try changing the first line to "class ShoppingBag(object):".

This is a somewhat annoying distinction that will hopefully go away in
a future version of python (when all classes become new style).

--
John.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to