Package entropy :: Module core :: Class Singleton

Class Singleton

source code


If your class wants to become a sexy Singleton, subclass this and replace __init__ with init_singleton

Instance Methods
bool
is_destroyed(self)
In our world, Singleton instances may be destroyed, this is done by setting a private bool var __is_destroyed
source code
bool
is_singleton(self)
Return if the instance is a singleton
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

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

Inherited from object: __class__

Method Details

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

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

is_destroyed(self)

source code 

In our world, Singleton instances may be destroyed, this is done by setting a private bool var __is_destroyed

Returns: bool
instance status, if destroyed or not

is_singleton(self)

source code 

Return if the instance is a singleton

Returns: bool
class singleton property, if singleton or not