U e5d‰ã@sºdZdd„ZGdd„deƒZGdd„deƒZGdd„deƒZz,d d lm Z m Z m Z m Z m Z mZmZmZWn*ek r’d d lmZm Z d e_YnXGd d„deƒZGdd„ded�ZdS)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__)Úfuncobj©rú/usr/lib64/python3.8/abc.pyÚabstractmethodsrcs$eZdZdZdZ‡fdd„Z‡ZS)ÚabstractclassmethodztA decorator indicating abstract classmethods. Deprecated, use 'classmethod' with 'abstractmethod' instead. Tcsd|_tƒ |¡dS©NT©rÚsuperÚ__init__©ÚselfÚcallable©Ú __class__rrr $szabstractclassmethod.__init__©Ú__name__Ú __module__Ú __qualname__Ú__doc__rr Ú __classcell__rrrrrsrcs$eZdZdZdZ‡fdd„Z‡ZS)ÚabstractstaticmethodzvA decorator indicating abstract staticmethods. Deprecated, use 'staticmethod' with 'abstractmethod' instead. Tcsd|_tƒ |¡dSrrr rrrr 1szabstractstaticmethod.__init__rrrrrr)src@seZdZdZdZdS)ÚabstractpropertyzoA decorator indicating abstract properties. Deprecated, use 'property' with 'abstractmethod' instead. TN)rrrrrrrrrr6sré)Úget_cache_tokenÚ _abc_initÚ _abc_registerÚ_abc_instancecheckÚ_abc_subclasscheckÚ _get_dumpÚ_reset_registryÚ _reset_caches)ÚABCMetarÚabccsReZdZdZ‡fdd„Zdd„Zdd„Zdd „Zdd d „Zd d„Z dd„Z ‡Z S)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Úclsrrrr#TszABCMeta.__new__cCs t||ƒS)z{Register a virtual subclass of an ABC. Returns the subclass, to allow usage as a class decorator. )r©r)ÚsubclassrrrÚregisterYszABCMeta.registercCs t||ƒS)z'Override for isinstance(instance, cls).)r)r)ÚinstancerrrÚ__instancecheck__`szABCMeta.__instancecheck__cCs t||ƒS)z'Override for issubclass(subclass, cls).)rr*rrrÚ__subclasscheck__dszABCMeta.__subclasscheck__NcCsŒtd|j›d|j›�|d�tdtƒ›�|d�t|ƒ\}}}}td|›�|d�td|›�|d�td|›�|d�td|›�|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)Úprintrrrr)r)r1Ú _abc_registryÚ _abc_cacheÚ_abc_negative_cacheÚ_abc_negative_cache_versionrrrÚ_dump_registryhsÿ ÿzABCMeta._dump_registrycCs t|ƒdS)z.Clear the registry (for debugging or testing).N)r©r)rrrÚ_abc_registry_cleartszABCMeta._abc_registry_clearcCs t|ƒdS)z,Clear the caches (for debugging or testing).N)r r8rrrÚ_abc_caches_clearxszABCMeta._abc_caches_clear)N) rrrrr#r,r.r/r7r9r:rrrrrr!Gs  r!c@seZdZdZdZdS)ÚABCzVHelper class that provides a standard way to create an ABC using inheritance. rN)rrrrÚ __slots__rrrrr;}sr;)Ú metaclassN)rrÚ classmethodrÚ staticmethodrÚpropertyrÚ_abcrrrrrrrr Ú ImportErrorZ_py_abcr!rÚtyper;rrrrÚs   , 6