lazysignals._utils ================== .. py:module:: lazysignals._utils Classes ------- .. autoapisummary:: lazysignals._utils.SingletonMeta Functions --------- .. autoapisummary:: lazysignals._utils.is_added Module Contents --------------- .. py:class:: SingletonMeta Bases: :py:obj:`type` A 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. .. py:attribute:: _instances .. py:method:: __call__(*args, **kwargs) Create and store a new instance of the class if it doesn't exist yet, or return the existing instance. .. py:function:: is_added(s, x) Adds an element to a set and returns if it was not already present. :param s: The set to add the element to. :param x: The element to add. :returns: ``True`` if ``x`` was not in ``s``, ``False`` otherwise.