B /g^*@s(ddlmZddZGdddeZdS))WeakSetcCstjS)N)ABCMeta_abc_invalidation_counterrr/usr/lib64/python3.7/_py_abc.pyget_cache_tokensrcsReZdZdZfddZddZdddZd d Zd d Zd dZ ddZ Z S)rrc  stj||||f|}dd|D}xF|D]>}x8t|dtD]&}t||d}t|ddrB||qBWq.Wt||_t|_ t|_ t|_ t j |_|S)NcSs h|]\}}t|ddr|qS)__isabstractmethod__F)getattr).0namevaluerrr &sz"ABCMeta.__new__..__abstractmethods__rF)super__new__itemsr setadd frozensetrr _abc_registry _abc_cache_abc_negative_cacherr_abc_negative_cache_version) mclsr bases namespacekwargsclsZ abstractsbaser ) __class__rrr#s     zABCMeta.__new__cCsPt|tstdt||r |St||r2td|j|tjd7_|S)NzCan only register classesz'Refusing to create an inheritance cycle) isinstancetype TypeError issubclass RuntimeErrorrrrr)rsubclassrrrregister6s    zABCMeta.registerNcCstd|jd|j|dtdt|dxJ|jD]@}|dr8t||}t|trbt |}t|d||dq8WdS)NzClass: .)filezInv. counter: Z_abc_z: ) print __module__ __qualname__r__dict__ startswithr r!rr)rr)r r rrr_dump_registryHs    zABCMeta._dump_registrycCs|jdS)N)rclear)rrrr_abc_registry_clearSszABCMeta._abc_registry_clearcCs|j|jdS)N)rr0r)rrrr_abc_caches_clearWs zABCMeta._abc_caches_clearcsb|j}|jkrdSt|}||krHjtjkr>|jkr>dS|Stfdd||fDS)NTFc3s|]}|VqdS)N)__subclasscheck__)r c)rrr jsz,ABCMeta.__instancecheck__..) rrr"rrrrr3any)rinstancer&Zsubtyper)rr__instancecheck__\s   zABCMeta.__instancecheck__cCst|tstd||jkr dS|jtjkr>t|_tj|_n||jkrLdS| |}|t k r|rp|j |n |j ||S|t |ddkr|j |dSx(|j D]}t||r|j |dSqWx*|D]}t||r|j |dSqW|j |dS)Nz"issubclass() arg 1 must be a classTF__mro__r)r!r"r#rrrrrr__subclasshook__NotImplementedrr rr$__subclasses__)rr&okZrclsZsclsrrrr3ls8              zABCMeta.__subclasscheck__)N) __name__r+r,rrr'r/r1r2r8r3 __classcell__rr)rrrs  rN)Z _weakrefsetrrr"rrrrrs