
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,a-  ã                   @   s(   d dl mZ dd„ ZG dd„ deƒZdS )é    )ÚWeakSetc                   C   s   t jS )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© r   r   ú,/opt/alt/python38/lib64/python3.8/_py_abc.pyÚget_cache_token   s    r   c                       sV   e Zd ZdZdZ‡ fdd„Zdd„ Zddd	„Zd
d„ Zdd„ Z	dd„ Z
dd„ Z‡  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          	         s–   t ƒ j| |||f|Ž}dd„ | ¡ D ƒ}|D ]:}t|dtƒ ƒD ]&}t||d ƒ}t|ddƒr>| |¡ q>q,t|ƒ|_tƒ |_	tƒ |_
tƒ |_tj|_|S )Nc                 S   s    h | ]\}}t |d dƒr|’qS )Ú__isabstractmethod__F)Úgetattr)Ú.0ÚnameÚvaluer   r   r   Ú	<setcomp>&   s   þz"ABCMeta.__new__.<locals>.<setcomp>Ú__abstractmethods__r   F)ÚsuperÚ__new__Úitemsr	   ÚsetÚaddÚ	frozensetr   r   Ú_abc_registryÚ
_abc_cacheÚ_abc_negative_cacher   r   Ú_abc_negative_cache_version)	Úmclsr   ÚbasesÚ	namespaceÚkwargsÚclsZ	abstractsÚbaser   ©Ú	__class__r   r   r   #   s    ÿ
zABCMeta.__new__c                 C   sP   t |tƒstdƒ‚t|| ƒr |S t| |ƒr2tdƒ‚| j |¡ t jd7  _|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   Úsubclassr   r   r   Úregister6   s    


zABCMeta.registerNc                 C   s|   t d| j› d| j› �|d� t dtƒ › �|d� | jD ]@}| d¡r6t| |ƒ}t|tƒr`t	|ƒ}t |› d|›�|d� q6dS )z'Debug helper to print the ABC registry.zClass: Ú.)ÚfilezInv. counter: Z_abc_z: N)
ÚprintÚ
__module__Ú__qualname__r   Ú__dict__Ú
startswithr	   r"   r   r   )r   r*   r   r   r   r   r   Ú_dump_registryH   s    



zABCMeta._dump_registryc                 C   s   | j  ¡  dS )z.Clear the registry (for debugging or testing).N)r   Úclear©r   r   r   r   Ú_abc_registry_clearS   s    zABCMeta._abc_registry_clearc                 C   s   | j  ¡  | j ¡  dS )z,Clear the caches (for debugging or testing).N)r   r1   r   r2   r   r   r   Ú_abc_caches_clearW   s    
zABCMeta._abc_caches_clearc                    sb   |j }|ˆ jkrdS t|ƒ}||krHˆ jtjkr>|ˆ jkr>dS ˆ  |¡S t‡ fdd„||fD ƒƒS )z'Override for isinstance(instance, cls).TFc                 3   s   | ]}ˆ   |¡V  qd S )N)Ú__subclasscheck__)r
   Úcr2   r   r   Ú	<genexpr>j   s     z,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r    r   r#   r   r   r   r   r5   Úany)r   Úinstancer'   Zsubtyper   r2   r   Ú__instancecheck__\   s    
ÿþ
zABCMeta.__instancecheck__c                 C   s  t |tƒstdƒ‚|| jkr dS | jtjk r>tƒ | _tj| _n|| jkrLdS |  	|¡}|t
k	rŽt |tƒslt‚|r~| j |¡ n| j |¡ |S | t|ddƒkr®| j |¡ dS | jD ] }t||ƒr´| j |¡  dS q´|  ¡ D ] }t||ƒrÞ| j |¡  dS qÞ| j |¡ dS )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ÚboolÚAssertionErrorr   r	   r   r%   Ú__subclasses__)r   r'   ÚokZrclsZsclsr   r   r   r5   l   s:    







zABCMeta.__subclasscheck__)N)Ú__name__r,   r-   Ú__doc__r   r   r(   r0   r3   r4   r:   r5   Ú__classcell__r   r   r   r   r      s   
r   N)Z_weakrefsetr   r   r#   r   r   r   r   r   Ú<module>   s   
