Package entropy :: Package core :: Class Singleton

Class Singleton

source code


If your class wants to become a sexy Singleton, subclass this and replace __init__ with init_singleton. Your subclass can expose a method called "is_destroyed()" that returns a bool stating if singleton instance has been destroyed.

Instance Methods
 
__init__(self, *args, **kwargs)
This is a fake method, necessary for Python 3.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
a new object with type S, a subtype of T
__new__(cls, *args, **kwds) source code
Properties

Inherited from object: __class__

Method Details

__init__(self, *args, **kwargs)
(Constructor)

source code 

This is a fake method, necessary for Python 3.

Overrides: object.__init__

__new__(cls, *args, **kwds)
Static Method

source code 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__
(inherited documentation)