2001 Enchancement Wishlist
aleaxit at yahoo.com
Fri Dec 29 18:49:28 EST 2000
"Fredrik Lundh" <fredrik at effbot.org> wrote in message
news:Ro736.2511$Qb7.273102 at newsb.telia.net...
> (fwiw, singleton classes are pretty unpythonic too. python
> already has a framework for creating exactly one instance of
> something: the module namespace).
Pity that isn't as flexible as an object-instance -- can't define
special methods to determine how it will print, how it will
let usercode loop on its items, etc.
Lightweight-class instances, delegating all state to their
module, can implement whatever special methods may be
handy, and still avoid any need for the Singleton design
pattern as per GoF (my least-favourite GoF DP).
More information about the Python-list