Singleton classes (with no such thing as static variables)

Giles Constant gilesc at hyperlink-interactive.co.uk
Mon Jul 2 06:45:24 EDT 2001


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