Using classes in python
gagsl-py at yahoo.com.ar
Thu Oct 26 01:00:16 CEST 2006
At Wednesday 25/10/2006 16:19, trevor lock wrote:
>I've just started using python and have observed the following :
> def __init__(self, val):
> self.a.append ( val )
It's a common pitfall. As seen just a few days ago:
>I was expecting that everytime I created an instance of the class
>that a unique dictionary was also created, however it seems that
>only one dictionary is created.
>How can I create a new dictionary for each instance?
Notice that you were using a *list* here, not a *dictionary*
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
More information about the Python-list