Singleton class: what is the purpose?

Aahz aahz at
Thu Jun 5 15:31:12 CEST 2003

In article <mailman.1054811769.993.python-list at>,
Gerrit Holl  <gerrit at> wrote:
>What is a singleton class? What is the purpose of a singleton class?

I'd like to reinforce Aldo's point (very late in his post) that modules
are the canonical simple way to get singleton behavior in Python.  In
addition, if you'll only be accessing the singleton object from one
module (the one that creates it), use a class object (*not* an instance)
as your singleton.
Aahz (aahz at           <*>

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra

More information about the Python-list mailing list