
    Rh-                     ,    d dl mZ d Z G d de      Zy)    )WeakSetc                  "    t         j                  S )zReturns the current ABC cache token.

    The token is an opaque object (supporting equality testing) identifying the
    current version of the ABC cache for virtual subclasses. The token changes
    with every call to ``register()`` on any ABC.
    )ABCMeta_abc_invalidation_counter     /usr/lib/python3.12/_py_abc.pyget_cache_tokenr
      s     ,,,r   c                   L     e Zd ZdZdZ fdZd Zd
dZd Zd Z	d Z
d	 Z xZS )r   ah  Metaclass for defining Abstract Base Classes (ABCs).

    Use this metaclass to create an ABC.  An ABC can be subclassed
    directly, and then acts as a mix-in class.  You can also register
    unrelated concrete classes (even built-in classes) and unrelated
    ABCs as 'virtual subclasses' -- these and their descendants will
    be considered subclasses of the registering ABC by the built-in
    issubclass() function, but the registering ABC won't show up in
    their MRO (Method Resolution Order) nor will method
    implementations defined by the registering ABC be callable (not
    even via super()).
    r   c          	         t        	|   | |||fi |}|j                         D ch c]  \  }}t        |dd      r| }}}|D ]H  }t        |dt	                     D ].  }t        ||d       }t        |dd      s|j                  |       0 J t        |      |_        t               |_	        t               |_
        t               |_        t        j                  |_        |S c c}}w )N__isabstractmethod__F__abstractmethods__)super__new__itemsgetattrsetadd	frozensetr   r   _abc_registry
_abc_cache_abc_negative_cacher   r   _abc_negative_cache_version)
mclsnamebases	namespacekwargsclsvalue	abstractsbase	__class__s
            r	   r   zABCMeta.__new__#   s    godD%EfE )2(9G$u'=uE  G	 G  	(D&;SUC (T405"8%@MM$'(	(
 #,I"6#I "))*1*K*K'
Gs   C%c                     t        |t              st        d      t        ||       r|S t        | |      rt	        d      | j
                  j                  |       t        xj                  dz  c_        |S )zsRegister a virtual subclass of an ABC.

        Returns the subclass, to allow usage as a class decorator.
        zCan only register classesz'Refusing to create an inheritance cycle   )	
isinstancetype	TypeError
issubclassRuntimeErrorr   r   r   r   )r   subclasss     r	   registerzABCMeta.register6   sk    
 (D)788h$O c8$HIIh'))Q.)r   c                 :   t        d| j                   d| j                   |       t        dt                |       | j                  D ]M  }|j                  d      st        | |      }t        |t              rt        |      }t        | d||       O y)z'Debug helper to print the ABC registry.zClass: .)filezInv. counter: _abc_z: N)
print
__module____qualname__r
   __dict__
startswithr   r&   r   r   )r   r/   r   r    s       r	   _dump_registryzABCMeta._dump_registryH   s    'q)9)9(:;$G012>LL 	7Dw'T*eW-JEb	*6	7r   c                 8    | j                   j                          y)z.Clear the registry (for debugging or testing).N)r   clearr   s    r	   _abc_registry_clearzABCMeta._abc_registry_clearS   s    !r   c                 l    | j                   j                          | j                  j                          y)z,Clear the caches (for debugging or testing).N)r   r8   r   r9   s    r	   _abc_caches_clearzABCMeta._abc_caches_clearW   s$    %%'r   c                      |j                   }| j                  v ryt        |      }||u r= j                  t        j
                  k(  r| j                  v ry j                  |      S t         fd||fD              S )z'Override for isinstance(instance, cls).TFc              3   @   K   | ]  }j                  |        y wN)__subclasscheck__).0cr   s     r	   	<genexpr>z,ABCMeta.__instancecheck__.<locals>.<genexpr>j   s     I3((+Is   )	r#   r   r'   r   r   r   r   r@   any)r   instancer+   subtypes   `   r	   __instancecheck__zABCMeta.__instancecheck__\   s     %%s~~%x.h//112C333((22Ih5HIIIr   c                 D   t        |t              st        d      || j                  v ry| j                  t
        j                  k  r%t               | _        t
        j                  | _        n|| j                  v ry| j                  |      }|t        urNt        |t              sJ |r| j                  j                  |       |S | j                  j                  |       |S | t        |dd      v r| j                  j                  |       y| j                  D ]+  }t        ||      s| j                  j                  |        y | j!                         D ]+  }t        ||      s| j                  j                  |        y | j                  j                  |       y)z'Override for issubclass(subclass, cls).z"issubclass() arg 1 must be a classTF__mro__r   )r&   r'   r(   r   r   r   r   r   r   __subclasshook__NotImplementedboolr   r   r   r)   __subclasses__)r   r+   okrclssclss        r	   r@   zABCMeta.__subclasscheck__l   so   (D)@AAs~~%**W-N-NN&-iC#.5.O.OC+000!!(+^#b$'''""8, I ''++H5I'(Ir22NNx(%% 	D(D)""8,	
 &&( 	D(D)""8,	
 	##H-r   r?   )__name__r2   r3   __doc__r   r   r,   r6   r:   r<   rG   r@   __classcell__)r#   s   @r	   r   r      s4    $ !"&$	7"(
J 'r   r   N)_weakrefsetr   r
   r'   r   r   r   r	   <module>rU      s    -Ed Er   