Hacked By AnonymousFox

Current Path : /opt/alt/python38/lib64/python3.8/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/__pycache__/_py_abc.cpython-38.pyc

U

i�f-�@s(ddlmZdd�ZGdd�de�ZdS)�)�WeakSetcCstjS)z�Returns 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�rr�,/opt/alt/python38/lib64/python3.8/_py_abc.py�get_cache_tokensrcsVeZdZdZdZ�fdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Z�ZS)rahMetaclass 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()).
    rc	s�t�j||||f|�}dd�|��D�}|D]:}t|dt��D]&}t||d�}t|dd�r>|�|�q>q,t|�|_t�|_	t�|_
t�|_tj
|_|S)NcSs h|]\}}t|dd�r|�qS)�__isabstractmethod__F)�getattr)�.0�name�valuerrr�	<setcomp>&s�z"ABCMeta.__new__.<locals>.<setcomp>�__abstractmethods__rF)�super�__new__�itemsr	�set�add�	frozensetrr�
_abc_registry�
_abc_cache�_abc_negative_cacherr�_abc_negative_cache_version)	�mclsr�bases�	namespace�kwargs�clsZ	abstracts�baser��	__class__rrr#s�
zABCMeta.__new__cCsPt|t�std��t||�r |St||�r2td��|j�|�tjd7_|S)zsRegister a virtual subclass of an ABC.

        Returns the subclass, to allow usage as a class decorator.
        zCan only register classesz'Refusing to create an inheritance cycle�)	�
isinstance�type�	TypeError�
issubclass�RuntimeErrorrrrr)r�subclassrrr�register6s


zABCMeta.registerNcCs|td|j�d|j��|d�tdt���|d�|jD]@}|�d�r6t||�}t|t�r`t	|�}t|�d|��|d�q6dS)z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: Z_abc_z: N)
�print�
__module__�__qualname__r�__dict__�
startswithr	r"rr)rr*rrrrr�_dump_registryHs



zABCMeta._dump_registrycCs|j��dS)z.Clear the registry (for debugging or testing).N)r�clear�rrrr�_abc_registry_clearSszABCMeta._abc_registry_clearcCs|j��|j��dS)z,Clear the caches (for debugging or testing).N)rr1rr2rrr�_abc_caches_clearWs
zABCMeta._abc_caches_clearcsb|j}|�jkrdSt|�}||krH�jtjkr>|�jkr>dS��|�St�fdd�||fD��S)z'Override for isinstance(instance, cls).TFc3s|]}��|�VqdS)N)�__subclasscheck__)r
�cr2rr�	<genexpr>jsz,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r rr#rrrrr5�any)r�instancer'Zsubtyperr2r�__instancecheck__\s
��
zABCMeta.__instancecheck__cCst|t�std��||jkr dS|jtjkr>t�|_tj|_n||jkrLdS|�	|�}|t
k	r�t|t�slt�|r~|j�
|�n|j�
|�|S|t|dd�kr�|j�
|�dS|jD] }t||�r�|j�
|�dSq�|��D] }t||�r�|j�
|�dSq�|j�
|�dS)z'Override for issubclass(subclass, cls).z"issubclass() arg 1 must be a classTF�__mro__r)r"r#r$rrrrrr�__subclasshook__�NotImplemented�bool�AssertionErrorrr	rr%�__subclasses__)rr'�okZrclsZsclsrrrr5ls:







zABCMeta.__subclasscheck__)N)
�__name__r,r-�__doc__rrr(r0r3r4r:r5�
__classcell__rrrrrs
rN)Z_weakrefsetrrr#rrrrr�<module>s

Hacked By AnonymousFox1.0, Coded By AnonymousFox