| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
Singleton
The singleton pattern.
To create a singleton class, you subclass from Singleton; each subclass will have a single instance, no matter how many times its constructor is called. To further initialize the subclass instance, subclasses should override 'init' instead of __init__ - the __init__ method is called each time the constructor is called.
From http://www.python.org/2.2.3/descrintro.html#__new__
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
staticmethod(function) -> method Convert a function to be a static method. A static method does not receive an implicit first argument. To declare a static method, use this idiom:
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Thu Feb 21 15:25:06 2008 | http://epydoc.sourceforge.net |