Get all the instances of one class

Tommy Nordgren tommy.nordgren at comhem.se
Sun May 18 14:49:59 EDT 2008


On 17 maj 2008, at 01.44, Terry wrote:

> Hi,
>
> Is there a simple way to get all the instances of one class? I mean
> without any additional change to the class.
>
> br, Terry
> --
> http://mail.python.org/mailman/listinfo/python-list


class MyClass : a_base_class
       memberlist=[]

#  Insert object in memberlist when created;
#  note: objects won't be garbage collected until removed from  
memberlist.
-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
tommy.nordgren at comhem.se







More information about the Python-list mailing list