grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026o ®û|jã@sÊdZgd¢ZiZddd„Zdd„ZzeWn eyYn wdd„Zeeeeƒd d „Zee e e Bƒeƒd d „Z d Z e e jƒZdd„Zdd„Zdd„Zdd„ZiZiZiZdd„Zdd„Zdd„ZdS)z¤Helper 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_extensionÚremove_extensionÚclear_extension_cacheNcCs0t|ƒstdƒ‚|t|<|durt|ƒdSdS)Nz$reduction functions must be callable)ÚcallableÚ TypeErrorÚdispatch_tabler)Úob_typeÚpickle_functionÚconstructor_ob©r ú./opt/alt/python310/lib64/python3.10/copyreg.pyr s  ÿrcCst|ƒstdƒ‚dS)Nzconstructors must be callable)rr)Úobjectr r r rsÿrcCst|j|jffS©N)ÚcomplexÚrealÚimag)Úcr r r Úpickle_complex"srcCs"ddl}ddl}|j|j|jffS)Né)Ú functoolsÚoperatorÚreduceÚor_Ú__args__)Úobjrrr r r Ú pickle_union'srcCs>|tur t |¡}|S| ||¡}|jtjkr| ||¡|Sr)rÚ__new__Ú__init__)ÚclsÚbaseÚstaterr r r Ú_reconstructor/s  ý  r"ic Cs|j}|jD]}t|dƒr|jt@sn|j}t|tƒr#|j|ur#nqt }|t ur-d}n||ur:t d|j ›d�ƒ‚||ƒ}|||f}z|j }Wn,t ytt|ddƒrat d|j ›d|›�ƒd‚z|j}Wn t yqd}YnwYnw|ƒ}|rt||fSt|fS)NÚ __flags__zcannot pickle z objectÚ __slots__zf object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol )Ú __class__Ú__mro__Úhasattrr#Ú _HEAPTYPErÚ isinstanceÚ _new_typeÚ__self__rrÚ__name__Ú __getstate__ÚAttributeErrorÚgetattrÚ__dict__r") ÚselfÚprotorr Únewr!ÚargsÚgetstateÚdictr r r Ú _reduce_ex=sF €     ýý  ÿ€ø  r7cGs|j|g|¢RŽSr©r)rr4r r r Ú __newobj__dsr9cCs|j|g|¢Ri|¤ŽS)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with keyword-only arguments to be pickled correctly. r8)rr4Úkwargsr r r Ú __newobj_ex__gsr;cCsÔ|j d¡}|dur |Sg}t|dƒsnI|jD]E}d|jvr\|jd}t|tƒr+|f}|D].}|dvr4q-| d¡rV| d¡sV|j  d¡}|rP|  d||f¡q-|  |¡q-|  |¡q-qz||_ W|SY|S)a›Return a list of slot names for a given class. This needs to find slots defined by the class and its bases, so we can't simply return the __slots__ attribute. We must walk down the Method Resolution Order and concatenate the __slots__ of each class found there. (This assumes classes don't modify their __slots__ attribute to misrepresent their slots after the class is defined.) Ú __slotnames__Nr$)r0Ú __weakref__Ú__Ú_z_%s%s) r0Úgetr'r&r)ÚstrÚ startswithÚendswithr,ÚlstripÚappendr<)rÚnamesrÚslotsÚnameÚstrippedr r r Ú _slotnamesms6         €ýrJcCs t|ƒ}d|krdkstdƒ‚tdƒ‚||f}t |¡|kr*t |¡|kr*dS|tvr8td|t|fƒ‚|tvrFtd|t|fƒ‚|t|<|t|<dS)zRegister an extension code.éiÿÿÿzcode out of rangeNz)key %s is already registered with code %sz$code %s is already in use for key %s)ÚintÚ ValueErrorÚ_extension_registryr@Ú_inverted_registry©ÚmodulerHÚcodeÚkeyr r r r¯s&ÿ ÿ ÿ rcCsV||f}t |¡|kst |¡|krtd||fƒ‚t|=t|=|tvr)t|=dSdS)z0Unregister an extension code. For testing only.z%key %s is not registered with code %sN)rNr@rOrMÚ_extension_cacherPr r r rÁsÿ ÿrcCs t ¡dSr)rTÚclearr r r r rÍs rr)Ú__doc__Ú__all__rrrrÚ NameErrorrrÚtyperLrAr"r(rr*r7r9r;rJrNrOrTrrrr r r r Ús6   ÿ  '<