U
e5d‰ ã @ sº d Z dd„ ZG dd„ deƒZG dd„ deƒZG dd„ deƒZz,d d
lm Z m
Z
mZmZm
Z
mZmZmZ W n* ek
r’ d dlmZm Z de_Y nX G d
d„ deƒZG dd„ ded�ZdS )z3Abstract Base Classes (ABCs) according to PEP 3119.c C s
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. abstractmethod() may be used to declare
abstract methods for properties and descriptors.
Usage:
class C(metaclass=ABCMeta):
@abstractmethod
def my_abstract_method(self, ...):
...
T)Ú__isabstractmethod__)Úfuncobj© r ú/usr/lib64/python3.8/abc.pyÚabstractmethod s r c s$ e Zd ZdZdZ‡ fdd„Z‡ ZS )ÚabstractclassmethodztA decorator indicating abstract classmethods.
Deprecated, use 'classmethod' with 'abstractmethod' instead.
Tc s d|_ tƒ |¡ d S ©NT©r ÚsuperÚ__init__©ÚselfÚcallable©Ú __class__r r r
$ s zabstractclassmethod.__init__©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r
Ú
__classcell__r r r r r s r c s$ e Zd ZdZdZ‡ fdd„Z‡ ZS )ÚabstractstaticmethodzvA decorator indicating abstract staticmethods.
Deprecated, use 'staticmethod' with 'abstractmethod' instead.
Tc s d|_ tƒ |¡ d S r r r r r r r
1 s zabstractstaticmethod.__init__r r r r r r ) s r c @ s e Zd ZdZdZdS )ÚabstractpropertyzoA decorator indicating abstract properties.
Deprecated, use 'property' with 'abstractmethod' instead.
TN)r r r r r r r r r r 6 s r é )Úget_cache_tokenÚ _abc_initÚ
_abc_registerÚ_abc_instancecheckÚ_abc_subclasscheckÚ _get_dumpÚ_reset_registryÚ
_reset_caches)ÚABCMetar Úabcc sR e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd „ Zddd„Zd
d„ Z dd„ Z
‡ ZS )r! a� 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()).
c s" t ƒ j| |||f|Ž}t|ƒ |S )N)r Ú__new__r )ÚmclsÚnameÚbasesÚ namespaceÚkwargsÚclsr r r r# T s zABCMeta.__new__c C s
t | |ƒS )z{Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
)r ©r) Úsubclassr r r ÚregisterY s zABCMeta.registerc C s
t | |ƒS )z'Override for isinstance(instance, cls).)r )r) Úinstancer r r Ú__instancecheck__` s zABCMeta.__instancecheck__c C s
t | |ƒS )z'Override for issubclass(subclass, cls).)r r* r r r Ú__subclasscheck__d s zABCMeta.__subclasscheck__Nc C sŒ t d| j› d| j› �|d� t dtƒ › �|d� t| ƒ\}}}}t d|›�|d� t d|›�|d� t d|›�|d� t d|›�|d� d S )
z'Debug helper to print the ABC registry.zClass: Ú.)ÚfilezInv. counter: z_abc_registry: z_abc_cache: z_abc_negative_cache: z_abc_negative_cache_version: N)Úprintr r r r )r) r1 Ú
_abc_registryÚ
_abc_cacheÚ_abc_negative_cacheÚ_abc_negative_cache_versionr r r Ú_dump_registryh s ÿ
ÿzABCMeta._dump_registryc C s t | ƒ dS )z.Clear the registry (for debugging or testing).N)r ©r) r r r Ú_abc_registry_cleart s zABCMeta._abc_registry_clearc C s t | ƒ dS )z,Clear the caches (for debugging or testing).N)r r8 r r r Ú_abc_caches_clearx s zABCMeta._abc_caches_clear)N)r r r r r# r, r. r/ r7 r9 r: r r r r r r! G s
r! c @ s e Zd ZdZdZdS )ÚABCzVHelper class that provides a standard way to create an ABC using
inheritance.
r N)r r r r Ú __slots__r r r r r; } s r; )Ú metaclassN)r r Úclassmethodr Ústaticmethodr Úpropertyr Ú_abcr r r r r r r r ÚImportErrorZ_py_abcr! r Útyper; r r r r Ú