+
    õÉÍjO
  ã                   ó<   € ^ RI t  ! R R]4      t ! R R]R7      tR# )é    Nc                   óR   a a€ ] tR t^t oRtV 3R ltV 3R lt]R 4       tRt	Vt
V ;t# )ÚSingletonMetaclassa³  Singleton Metaclass.

This metaclass is used for creating singletons.
It changes the class __new__ method to maintain only one instance of the
class, and tweaks the __init__ method to be executed only once (when the
first instance of the class is created.

Usage::

    >>> class MySingleton(object, metaclass=SingletonMetaclass):
    ...     '''Real singleton class.
    ...
    ...     You have to set the metaclass to SingletonMetaclass,
    ...     and define the __init__ function. Everything else will
    ...     be done by metaclass.
    ...     '''
    ...     def __init__(self, data):
    ...         print("Initializing")
    ...         self.data = data
    ...
    >>> # Only this actually happen
    >>> first = MySingleton("First initialization")
    Initializing
    >>> second = MySingleton("Second initialization") # This won't happen
    >>> first.data
    'First initialization'
    >>> second.data
    'First initialization'
c                ór   <€ \         \        V `
  ! V/ VB  R V n        \        P
                  ! 4       V n        R # ©N)Úsuperr   Ú__init__Ú	_instanceÚ	threadingÚLockÚ_lock©ÚclsÚargsÚkwargsÚ	__class__s   &*,€ÚG/opt/data/home/.local/lib/python3.14/site-packages/tea/dsa/singleton.pyr   ÚSingletonMetaclass.__init__#   s-   ø€ ÜÔ  #Ò/°Ð@¸Ò@ØˆŒÜ—N’NÓ$ˆŽ	ó    c                óÐ   <€ V P                   ;_uu_ 4        V P                  f   \        \        V `  ! V/ VB V n        V P                  uuR R R 4       #   + '       g   i     R # ; ir   )r   r	   r   r   Ú__call__r   s   &*,€r   r   ÚSingletonMetaclass.__call__(   sJ   ø€ Ø�Y�Y‹YØ�}‰}Ò$Ü %Ô&8¸#Ò GØð!Ø#ñ!�”ð —=‘=÷ �Y�Y‹Yús   –3AÁA%	c                ó€   € V P                   ;_uu_ 4        V P                  uuR R R 4       #   + '       g   i     R # ; ir   )r   r	   )r   s   &r   ÚinstanceÚSingletonMetaclass.instance0   s   € à�Y�Y‹YØ—=‘=÷ �Y�Y‹Yús   •,¬=	© )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Úpropertyr   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   Ú__classdict__s   @@r   r   r      s-   ù‡ € ñõ<%õ
!ð ñ!ó ÷!ð !r   r   c                   ó   € ] tR t^6tRtRtR# )Ú	Singletona>  Singleton class.

Inherit from this class if you want to have a singleton class.

Never use SingletonMetaclass!

Usage::

    >>> class EmptySingleton(Singleton):
    ...     '''Singleton without __init__ method'''
    ...     pass
    ...
    >>> first = EmptySingleton()
    >>> second = EmptySingleton()
    >>> assert id(first) == id(second)
    >>>
    >>> class InitSingleton(Singleton):
    ...     '''Singleton with __init__ method'''
    ...     def __init__(self, data):
    ...         print("Initializing")
    ...         self.data = data
    ...
    >>> # Only this actually happen
    >>> first = InitSingleton("First initialization")
    Initializing
    >>> second = InitSingleton("Second initialization") # This won't happen
    >>> first.data
    'First initialization'
    >>> assert first.data == second.data
r   N)r   r   r   r   r    r"   r   r   r   r'   r'   6   s   † ñó> 	r   r'   )Ú	metaclass)r
   Útyper   r'   r   r   r   Ú<module>r*      s"   ðÛ ô/!˜ô /!ôd 	Ð,÷  	r   