lazysignals._utils¶
Classes¶
A metaclass for creating singleton classes. |
Functions¶
|
Adds an element to a set and returns if it was not already present. |
Module Contents¶
- class SingletonMeta¶
Bases:
typeA metaclass for creating singleton classes.
This metaclass ensures that only one instance of a class is created, and that all subsequent calls to the constructor return the same instance.
- _instances¶
- __call__(*args, **kwargs)¶
Create and store a new instance of the class if it doesn’t exist yet, or return the existing instance.
- is_added(s, x)¶
Adds an element to a set and returns if it was not already present.
- Parameters:
s – The set to add the element to.
x – The element to add.
- Returns:
Trueifxwas not ins,Falseotherwise.