Your IP : 3.139.88.22


Current Path : /lib64/python3.6/__pycache__/
Upload File :
Current File : //lib64/python3.6/__pycache__/abc.cpython-36.pyc

3


 \"�@svdZddlmZdd�ZGdd�de�ZGdd�de�ZGd	d
�d
e�Z	Gdd�de
�ZGd
d�ded�Zdd�Z
dS)z3Abstract Base Classes (ABCs) according to PEP 3119.�)�WeakSetcCs
d|_|S)a�A decorator indicating abstract methods.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract methods are overridden.
    The abstract methods can be called using any of the normal
    'super' call mechanisms.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractmethod
            def my_abstract_method(self, ...):
                ...
    T)�__isabstractmethod__)�funcobj�r�/usr/lib64/python3.6/abc.py�abstractmethod	srcs$eZdZdZdZ�fdd�Z�ZS)�abstractclassmethodaO
    A decorator indicating abstract classmethods.

    Similar to abstractmethod.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractclassmethod
            def my_abstract_classmethod(cls, ...):
                ...

    'abstractclassmethod' is deprecated. Use 'classmethod' with
    'abstractmethod' instead.
    Tcsd|_t�j|�dS)NT)r�super�__init__)�self�callable)�	__class__rrr
0szabstractclassmethod.__init__)�__name__�
__module__�__qualname__�__doc__rr
�
__classcell__rr)r
rrsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractstaticmethodaO
    A decorator indicating abstract staticmethods.

    Similar to abstractmethod.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractstaticmethod
            def my_abstract_staticmethod(...):
                ...

    'abstractstaticmethod' is deprecated. Use 'staticmethod' with
    'abstractmethod' instead.
    Tcsd|_t�j|�dS)NT)rr	r
)rr)r
rrr
Hszabstractstaticmethod.__init__)rrrrrr
rrr)r
rr5src@seZdZdZdZdS)�abstractpropertyak
    A decorator indicating abstract properties.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract properties are overridden.
    The abstract properties can be called using any of the normal
    'super' call mechanisms.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractproperty
            def my_abstract_property(self):
                ...

    This defines a read-only property; you can also define a read-write
    abstract property using the 'long' form of property declaration:

        class C(metaclass=ABCMeta):
            def getx(self): ...
            def setx(self, value): ...
            x = abstractproperty(getx, setx)

    'abstractproperty' is deprecated. Use 'property' with 'abstractmethod'
    instead.
    TN)rrrrrrrrrrMsrcsFeZdZdZdZ�fdd�Zdd�Zddd	�Zd
d�Zdd
�Z	�Z
S)�ABCMetaaiMetaclass 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�|j�D�}xF|D]>}x8t|dt��D]&}t||d�}t|dd�rB|j|�qBWq.Wt|�|_t�|_	t�|_
t�|_tj
|_|S)NcSs h|]\}}t|dd�r|�qS)rF)�getattr)�.0�name�valuerrr�	<setcomp>�sz"ABCMeta.__new__.<locals>.<setcomp>�__abstractmethods__rF)r	�__new__�itemsr�set�add�	frozensetrr�
_abc_registry�
_abc_cache�_abc_negative_cacher�_abc_invalidation_counter�_abc_negative_cache_version)	�mclsr�bases�	namespace�kwargs�cls�	abstracts�baser)r
rrr�s

zABCMeta.__new__cCsPt|t�std��t||�r |St||�r2td��|jj|�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�RuntimeErrorr!rrr$)r*�subclassrrr�register�s


zABCMeta.registerNcCs|td|j|jf|d�tdtj|d�xLt|j�D]>}|jd�r6t||�}t	|t
�r`t|�}td||f|d�q6WdS)z'Debug helper to print the ABC registry.zClass: %s.%s)�filezInv.counter: %s�_abc_z%s: %rN)�printrrrr$�sorted�__dict__�
startswithrr.rr)r*r5rrrrr�_dump_registry�s


zABCMeta._dump_registrycsb|j}|�jkrdSt|�}||krH�jtjkr>|�jkr>dS�j|�St�fdd�||hD��S)z'Override for isinstance(instance, cls).TFc3s|]}�j|�VqdS)N)�__subclasscheck__)r�c)r*rr�	<genexpr>�sz,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r
r"r/r%rr$r#r<�any)r*�instancer3�subtyper)r*r�__instancecheck__�s


zABCMeta.__instancecheck__cCs||jkrdS|jtjkr,t�|_tj|_n||jkr:dS|j|�}|tk	r|t|t	�sZt
�|rl|jj|�n|jj|�|S|t|df�kr�|jj|�dSx(|j
D]}t||�r�|jj|�dSq�Wx*|j�D]}t||�r�|jj|�dSq�W|jj|�dS)z'Override for issubclass(subclass, cls).TF�__mro__)r"r%rr$rr#�__subclasshook__�NotImplementedr.�bool�AssertionErrorrrr!r1�__subclasses__)r*r3�ok�rcls�sclsrrrr<�s6





zABCMeta.__subclasscheck__)N)rrrrr$rr4r;rBr<rrr)r
rrms
rc@seZdZdZdS)�ABCzVHelper class that provides a standard way to create an ABC using
    inheritance.
    N)rrrrrrrrrL�srL)�	metaclasscCstjS)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.
    )rr$rrrr�get_cache_token�srNN)r�_weakrefsetrr�classmethodr�staticmethodr�propertyrr/rrLrNrrrr�<module>s