[Tutor] Deleting singleton objects
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Thu, 23 May 2002 06:43:58 -0700 (PDT)
On Thu, 23 May 2002 alan.gauld@bt.com wrote:
> > BTW is there a more efficient or standard way of implementing a
> > singleton in Python, that is a lot "cleaner".
>
> I think so.
>
> Try a seach on google groups where youl fnd it duscussed(frequently) on
> comp.lang.python.
>
> Also search this list archive on Activestate where (I think it
> was Danny) did a nice version based on the class __call__() method.
Probably wasn't me, since I still have to start reading Design Patterns.
*grin*
The Python Cookbook by Activestate has a bunch of Singleton recipes that
might be useful:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558
Good luck to you!