
    	h                     8    S SK r  " S S\5      r " S S\5      rg)    Nc                   8   ^  \ rS rSrSrU 4S jrU 4S jrSrU =r$ )	Singleton   z
Singleton metaclass
Based on Python Cookbook 3rd Edition Recipe 9.13
Only one instance of a class can exist. Does not work with __slots__
c                 4   > [         TU ]  " U0 UD6  S U l        g N)super__init___Singleton__instanceselfargskw	__class__s      K/var/www/html/env/lib/python3.13/site-packages/openpyxl/compat/singleton.pyr	   Singleton.__init__   s    $%"%    c                 `   > U R                   c  [        TU ]  " U0 UD6U l         U R                   $ r   )r
   r   __call__r   s      r   r   Singleton.__call__   s-    ??"#g.;;DOr   )
__instance	__name__
__module____qualname____firstlineno____doc__r	   r   __static_attributes____classcell__r   s   @r   r   r      s     r   r   c                   8   ^  \ rS rSrSrU 4S jrU 4S jrSrU =r$ )Cached   z
Caching metaclass
Child classes will only create new instances of themselves if
one doesn't already exist. Does not work with __slots__
c                 Z   > [         TU ]  " U0 UD6  [        R                  " 5       U l        g r   )r   r	   weakrefWeakValueDictionary_Cached__cacher   s      r   r	   Cached.__init__   s%    $%"%224r   c                 z   > XR                   ;   a  U R                   U   $ [        TU ]  " U6 nX R                   U'   U$ r   )r&   r   r   )r   r   objr   s      r   r   Cached.__call__"   s<    <<<<%%g% T
r   )__cacher   r   s   @r   r!   r!      s    5 r   r!   )r$   typer   r!    r   r   <module>r.      s"     "T r   