[Python-Dev] PEP 318: Singleton decorator

Skip Montanaro skip at pobox.com
Thu Apr 8 17:29:27 EDT 2004

(Still catching up.  I guess no help with the substance of the PEP will be
forthcoming, so I'll try to get to things as I can.)

       ... [snip] ...

    Ping> But i don't think this is a good way to write a singleton, because
    Ping> then the user of the class has to get instances by saying
    Ping> "MyClass" instead of "MyClass()".  Better would be:

       ... [snip] ...

    Ping> I respectfully suggest that the PEP use the latter implementation
    Ping> in its singleton example instead.



More information about the Python-Dev mailing list