a DOg8@sdZddZGdddeZGdddeZGdddeZz,d d lm Z m Z m Z m Z m Z mZmZmZWn(eyd d lmZm Z d e_Yn0Gd ddeZGdddedZdS)z3Abstract Base Classes (ABCs) according to PEP 3119.cCs 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__)funcobjr(/opt/alt/python39/lib64/python3.9/abc.pyabstractmethodsrcs$eZdZdZdZfddZZS)abstractclassmethodaA decorator indicating abstract classmethods. Deprecated, use 'classmethod' with 'abstractmethod' instead: class C(ABC): @classmethod @abstractmethod def my_abstract_classmethod(cls, ...): ... Tcsd|_t|dSNTrsuper__init__selfcallable __class__rrr +szabstractclassmethod.__init____name__ __module__ __qualname____doc__rr __classcell__rrrrrs rcs$eZdZdZdZfddZZS)abstractstaticmethodaA decorator indicating abstract staticmethods. Deprecated, use 'staticmethod' with 'abstractmethod' instead: class C(ABC): @staticmethod @abstractmethod def my_abstract_staticmethod(...): ... Tcsd|_t|dSrrr rrrr ?szabstractstaticmethod.__init__rrrrrr0s rc@seZdZdZdZdS)abstractpropertyzA decorator indicating abstract properties. Deprecated, use 'property' with 'abstractmethod' instead: class C(ABC): @property @abstractmethod def my_abstract_property(self): ... TN)rrrrrrrrrrDs r)get_cache_token _abc_init _abc_register_abc_instancecheck_abc_subclasscheck _get_dump_reset_registry _reset_caches)ABCMetarabccsReZdZdZfddZddZddZdd Zdd d Zd dZ ddZ Z S)r!aMetaclass 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&tj||||fi|}t||S)N)r __new__r)mclsnamebases namespacekwargsclsrrrr#iszABCMeta.__new__cCs t||S)z{Register a virtual subclass of an ABC. Returns the subclass, to allow usage as a class decorator. )rr)subclassrrrregisternszABCMeta.registercCs t||S)z'Override for isinstance(instance, cls).)r)r)instancerrr__instancecheck__uszABCMeta.__instancecheck__cCs t||S)z'Override for issubclass(subclass, cls).)rr*rrr__subclasscheck__yszABCMeta.__subclasscheck__NcCstd|jd|j|dtdt|dt|\}}}}td||dtd||dtd||dtd||dd 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)printrrrr)r)r1 _abc_registry _abc_cache_abc_negative_cache_abc_negative_cache_versionrrr_dump_registry}s zABCMeta._dump_registrycCs t|dS)z.Clear the registry (for debugging or testing).N)rr)rrr_abc_registry_clearszABCMeta._abc_registry_clearcCs t|dS)z,Clear the caches (for debugging or testing).N)r r8rrr_abc_caches_clearszABCMeta._abc_caches_clear)N) rrrrr#r,r.r/r7r9r:rrrrrr!\s  r!c@seZdZdZdZdS)ABCzVHelper class that provides a standard way to create an ABC using inheritance. rN)rrrr __slots__rrrrr;sr;) metaclassN)rr classmethodr staticmethodrpropertyr_abcrrrrrrrr ImportErrorZ_py_abcr!rtyper;rrrrs,  6