Detecting a new style class

Alex Martelli aleax at aleax.it
Fri Apr 26 18:26:39 EDT 2002


Aahz wrote:
        ...
> What do you need Borg for?  Alex himself has agreed that using a module
> as a singleton is the correct answer 80-90% of the time.

More than that: it's 80%-90% of the time *in which people DO think about
Singleton*, plus a few times in which that doesn't even come to mind.  Add
in a class instance masquerading as a module, as for example in
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65207 , and
it must be over 90%.

But if you DO need to subclass the One And Only -- most of the remaining
8-9% of the time is covered by that -- then Borg is good.


Alex




More information about the Python-list mailing list