B eiǐpe@sdddddgZiZdddZddZyeWnek r@YnXdd Zeeeed d Zd Zd dZ ddZ ddZ ddZ iZ iZiZddZddZddZdS)pickle constructor add_extensionremove_extensionclear_extension_cacheNcCs,t|std|t|<|dk r(t|dS)Nz$reduction functions must be callable)callable TypeErrordispatch_tabler)ob_typepickle_functionconstructor_obr */opt/alt/python37/lib/python3.7/copyreg.pyr s cCst|stddS)Nzconstructors must be callable)rr)objectr r r rscCst|j|jffS)N)complexrealimag)cr r r pickle_complex"srcCs<|tkrt|}n$|||}|jtjkr8||||S)N)r__new____init__)clsbasestateobjr r r _reconstructor)s     ric Csx*|jjD]}t|dr |jt@s Pq Wt}|tkr:d}n ||jkrRtd|j||}|j||f}y |j}WnNt k rt |ddrtddy |j }Wnt k rd}YnXYnX|}|rt ||fSt |fSdS)N __flags__zcan't pickle %s objects __slots__zNa class that defines __slots__ without defining __getstate__ cannot be pickled) __class____mro__hasattrr _HEAPTYPErr__name__ __getstate__AttributeErrorgetattr__dict__r)selfprotorrargsgetstatedictr r r _reduce_ex6s0      r+cGs|j|f|S)N)r)rr(r r r __newobj__Wsr,cCs|j|f||S)N)r)rr(kwargsr r r __newobj_ex__Zsr.cCs|jd}|dk r|Sg}t|ds(nx|jD]}d|jkr0|jd}t|trX|f}xf|D]^}|dkrnq^q^|dr|ds|j d}|r| d||fq| |q^| |q^Wq0Wy ||_ Wn YnX|S)N __slotnames__r)r% __weakref_____z_%s%s) r%getrr isinstancestr startswithendswithr!lstripappendr/)rnamesrslotsnamestrippedr r r _slotnames`s2          r>cCst|}d|krdks&ntd||f}t||krNt||krNdS|tkrjtd|t|f|tkrtd|t|f|t|<|t|<dS)Nizcode out of rangez)key %s is already registered with code %sz$code %s is already in use for key %s)int ValueError_extension_registryr3_inverted_registry)moduler<codekeyr r r rscCsR||f}t||ks$t||kr4td||ft|=t|=|tkrNt|=dS)Nz%key %s is not registered with code %s)rBr3rCrA_extension_cache)rDr<rErFr r r rs cCs tdS)N)rGclearr r r r rs)N)__all__rrrr NameErrorrrr r+r,r.r>rBrCrGrrrr r r r s,    !<