Singleton classes (with no such thing as static variables)

Steve Holden sholden at holdenweb.com
Mon Jul 2 08:38:04 EDT 2001


http://www.faqts.com/knowledge_base/view.phtml/aid/1667/fid/242

--
http://www.holdenweb.com/


"Giles Constant" <gilesc at hyperlink-interactive.co.uk> wrote in message
news:MdY%6.168$iF.4908 at news.lhr.globix.net...
> Hi there,
>
> Being a C++ head, it's probably more a problem with my design than a
python
> problem, but I figured you guys would be able to help.
>
> I'm trying to make a class called "Environment" which will store some
> global data such that all instances of the class have access to it.  The
> alternative is to create a single instance and pass it around every single
> object in the entire project, but it gets used so frequently that it would
> be rediculous.
>
> Is there a way of doing this, or do I need a new paradigm? :-)
>





More information about the Python-list mailing list