QfdZgdZiZddZdZdZeeeedZeee e zedZ dZ ee jZd Zd Zd Zd ZiZiZiZd ZdZdZy)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_cacheNc^t|s td|t|<| t|yy)Nz$reduction functions must be callable)callable TypeErrordispatch_tabler)ob_typepickle_functionconstructor_obs ./opt/alt/python312/lib64/python3.12/copyreg.pyrr s5 O $>??-N7!N#"c0t|s tdy)Nzconstructors must be callable)rr )objects rrrs F 788 rc>t|j|jffSN)complexrealimag)cs rpickle_complexrs QVVQVV$ $$rcZddl}ddl}|j|j|jffS)N) functoolsoperatorreduceor___args__)objrrs r pickle_unionr!!s#   hllCLL9 99rc|turtj|}|S|j||}|jtjk7r|j|||Sr)r__new____init__)clsbasestater s r_reconstructorr()sS v~nnS! Jll3& ==FOO + MM#u % Jric|j}|jD]P}t|dr|jtzsn5|j }t |tsA|j|usPnt}|turd}n%||urtd|jd||}|||f} |j}t|jtjurt|ddr td|}|r t"||fSt"|fS#t$rKt|ddrtd|jd|d |j }n#t$rd}YnwxYwYfwxYw)N __flags__zcannot pickle z object __slots__zNa class that defines __slots__ without defining __getstate__ cannot be pickledzf 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__typegetattrAttributeError__dict__r() selfprotor%r&newr'argsgetstatedicts r _reduce_exr?7sv ..C  4 %dnny.H ll c9 %#,,$*>   v~ 3;nS\\, E  E EEEEEc(|j|g|Srr#)r%r<s r __newobj__rBbs 3;;s "T ""rc.|j|g|i|S)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with keyword-only arguments to be pickled correctly. rA)r%r<kwargss r __newobj_ex__rEes 3;;s ,T ,V ,,rc|jjd}||Sg}t|dsn|jD]}d|jvs|jd}t |t r|f}|D]}|dvr|j drW|jdsF|jjd}|r|jd||^|j|p|j| ||_ |S#Y|SxYw)aReturn 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__r+)r8 __weakref_____) r8getr.r-r0str startswithendswithr3lstripappendrG)r%namesrslotsnamestrippeds r _slotnamesrUks LL  _ -E   E 3 $ Aajj( ;/eS)"HE!D:: .t}}T7J#$::#4#4S#9#!LLHd)CD!LL. T*" * ! L  Ls 7DDclt|}d|cxkrdkstdtd||f}tj||k(rtj||k(ry|tvrtd|dt||tvrtd|dt||t|<|t|<y) zRegister an extension code.izcode out of rangeNkey z! is already registered with code zcode z is already in use for key )int ValueError_extension_registryrK_inverted_registrymodulerScodekeys rrrs t9D  " ",-- #,-- 4.C$,t$+ !!2379: : !! 24 8:; ;#"trc||f}tj||k7stj||k7rtd|d|t|=t|=|tvrt|=yy)z0Unregister an extension code. For testing only.rXz is not registered with code N)r[rKr\rZ_extension_cacher]s rrrsn 4.C$,t$+t%& &C 4   T " rc,tjyr)rbclearrrrrsrr)__doc____all__r rrrrr!r5rYrLr(r/r#r1r?rBrErUr[r\rbrrrrerrrhs  I$9 %w(:tC#I %    '$V#- 1x#$ #r