Frans Englich wrote: > On Monday 17 January 2005 20:03, John Roth wrote: >> "Frans Englich" <[EMAIL PROTECTED]> wrote in message > > <snip> > >> In other words, you're trying to create a singleton. In general, >> singletons are frowned on these days for a number of reasons, >> not least because of the difficulty of testing them. > > Then I have some vague, general questions which perhaps someone can reason > from: what is then the preferred methods for solving problems which > requires Singletons? Is it only frowned upon in Python code?
Sorry, no answer here, but do you really want a singleton? Singleton: "Ensure a class only has one instance, and provide a global point of access to it" whereas Flyweight: "Use sharing to support large numbers of fine-grained objects efficiently" as per "Design Patterns" by Gamma et al. Peter -- http://mail.python.org/mailman/listinfo/python-list