Assigning to self
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Tue Jan 18 18:21:21 EST 2005
In <mailman.816.1105995336.22381.python-list at python.org>, Frans Englich
wrote:
> 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?
As already mentioned it's similar to a global variable. If I need a
"Singleton" I just put it as global into a module. Either initialize it
at module level or define a function with the content of your __init__().
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list