an example of a singleton design pattern in python?

Aahz aahz at pythoncraft.com
Wed Jan 21 19:38:26 EST 2004


In article <hc63caapdui.fsf at praxis.lsil.com>,
Daniel Ortmann  <dortmann at lsil.com> wrote:
>
>Does anyone have an example of a singleton design pattern in python?

It appears that none of the other responses mentioned the two simplest
techniques:

* Within a single module, use a global class as your singleton object.

* Across modules, use a module as your singleton object.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

A: No.
Q: Is top-posting okay?



More information about the Python-list mailing list