Brian Elmegaard wrote:
> bruno at modulix <[EMAIL PROTECTED]> writes:
>
>
>>So it's time to move to 2.4x !-)
>
>
> I guess so.
>
>
>
>>What is "going wrong" exactly ?
>
>
> def _add_instance(cls, instance):
> _add_instance=classmethod(_add_instance)
> cls._instances.append(instance)
You want
def _add_instance(cls, instance):
cls._instances.append(instance)
_add_instance=classmethod(_add_instance)
(snip)
>>Also, if you intend to use such a solution (with or without multiple
>>lists), you may want to add a classmethod to delete instances from the
>>list(s).
>
>
> I will have to study classmethods.
May I suggest that you first learn the language syntax and basics ?-)
FWIW, a classmethod is a method that get the class object as first
argument (instance methods get a reference to the instance).
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailman/listinfo/python-list