singleton problems

Arnaud Delobelle arnodel at
Sun Oct 3 13:11:25 CEST 2010

Arnaud Delobelle <arnodel at> writes:
> That's because overriding __new__ doesn't prevent __init__ from being
> executed.  The reason for this is that when you do:
>     MySingle('jeff')
> what is executed is:
>     MySingle.__metaclass__.__call__('jeff')

Oops. I meant:

     MySingle.__metaclass__.__call__(MySingle, 'jeff')


More information about the Python-list mailing list