U e5d@sdZdddddgZiZdddZddZzeWnek rDYnXd d Zeeeed d Zd Z ddZ ddZ ddZ ddZ iZiZiZddZddZddZdS)zHelper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. 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 /usr/lib64/python3.8/copyreg.pyr s cCst|stddS)Nzconstructors must be callable)rr)objectr r r rscCst|j|jffSN)complexrealimag)cr r r pickle_complex"srcCs<|tkrt|}n$|||}|jtjkr8||||Sr)r__new____init__)clsbasestateobjr r r _reconstructor)s     ric Cs|j}|jD]}t|dr |jt@s q.q t}|tkrcodekeyr r r rs$   cCsR||f}t||ks$t||kr4td||ft|=t|=|tkrNt|=dS)z0Unregister an extension code. For testing only.z%key %s is not registered with code %sN)rDr5rErC_extension_cacherFr r r rs cCs tdSr)rJclearr r r r rs)N)__doc____all__rrrr NameErrorrrr!r,r.r0r@rDrErJrrrr r r r s4   $<