Qf-,ddlmZdZGddeZy))WeakSetc"tjS)zReturns 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./opt/alt/python312/lib64/python3.12/_py_abc.pyget_cache_tokenr s  , ,,rcLeZdZdZdZfdZdZd dZdZdZ dZ d Z xZ S) rahMetaclass 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 t |||||fi|}|jDchc]\}}t|ddr|}}}|D]H}t|dt D].}t||d}t|dds|j |0Jt ||_t|_ t|_ t|_ tj|_|Scc}}w)N__isabstractmethod__F__abstractmethods__)super__new__itemsgetattrsetadd frozensetrr _abc_registry _abc_cache_abc_negative_cacherr_abc_negative_cache_version) mclsnamebases namespacekwargsclsvalue abstractsbase __class__s r rzABCMeta.__new__#sgodD%EfE)2(9G(9u'=uE(9 GD&;SUCT405"8%@MM$'D #,I"6#I "))*1*K*K' GsC%ct|ts tdt||r|St||r t d|j j |txjdz c_|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) isinstancetype TypeError issubclass RuntimeErrorrrrr)rsubclasss r registerzABCMeta.register6sk (D)78 8 h $O c8 $HI I h'))Q.)rc:td|jd|j|tdt||jD]M}|j dst ||}t|tr t|}t|d||Oy)z'Debug helper to print the ABC registry.zClass: .)filezInv. counter: _abc_z: N) print __module__ __qualname__r __dict__ startswithrr&rr)rr/rr s r _dump_registryzABCMeta._dump_registryHs 'q)9)9(:;$G 012>LLDw'T*eW-JEb *6 !rc8|jjy)z.Clear the registry (for debugging or testing).N)rclearrs r _abc_registry_clearzABCMeta._abc_registry_clearSs !rcl|jj|jjy)z,Clear the caches (for debugging or testing).N)rr8rr9s r _abc_caches_clearzABCMeta._abc_caches_clearWs$  %%'rc|j}|jvryt|}||ur=jtj k(r|j vryj|Stfd||fDS)z'Override for isinstance(instance, cls).TFc3@K|]}j|ywN)__subclasscheck__).0crs r z,ABCMeta.__instancecheck__..jsI5H3((+5Hs) r#rr'rrrrr@any)rinstancer+subtypes` r __instancecheck__zABCMeta.__instancecheck__\s%% s~~ %x. h //112C333((2 2Ih5HIIIrc t|ts td||jvry|jt j kr%t|_t j |_n||jvry|j|}|tur<|r|jj||S|jj||S|t|ddvr|jj|y|jD]+}t||s|jj|y|jD]+}t||s|jj|y|jj|y)z'Override for issubclass(subclass, cls).z"issubclass() arg 1 must be a classTF__mro__r)r&r'r(rrrrrr__subclasshook__NotImplementedrrrr)__subclasses__)rr+okrclssclss r r@zABCMeta.__subclasscheck__lsU(D)@A A s~~ %  * *W-N-N N&-iC #.5.O.OC + 00 0  ! !( + ^ #""8,I''++H5I '(Ir2 2 NN  x (%%D(D)""8,& &&(D(D)""8,) ##H-rr?) __name__r2r3__doc__rrr,r6r:r<rGr@ __classcell__)r#s@r rrs4 $!"&$ 7"( J 'rrN) _weakrefsetrr r'rrrr rTs-EdEr