\ddZgdZiZddZdZ edZeeeen #e$rYnwxYwdZee e e zedZ dZ e e jZd Zd Zd Zd ZiZiZiZd ZdZdZdS)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|std|t|<|t|dSdS)Nz$reduction functions must be callable)callable TypeErrordispatch_tabler)ob_typepickle_functionconstructor_obs 5J:\tools\MySQL Workbench 8.0 CE\python\Lib\copyreg.pyrr sP O $ $@>???-N7!N#####"!cBt|stddS)Nzconstructors must be callable)rr )objects rrrs+ F  9788899rc,t|j|jffSN)complexrealimag)cs rpickle_complexr"s(((rc<ddl}ddl}|j|j|jffS)N) functoolsoperatorreduceor___args__)objrrs r pickle_unionr!'s1  hlCL9 99rc|turt|}nA|||}|jtjkr||||Sr)r__new____init__)clsbasestater s r_reconstructorr(/sY v~~nnS!!ll3&& =FO + + MM#u % % % Jric|dksJ|j}|jD]J}t|dr|jtzsn/|j}t |tr |j|urnKt}|turd}n'||urtd|j d||}|||f} |j }t|j tj ur t|ddrtd|}nW#t$rJt|ddrtd|j d|d |j}n#t$rd}YnwxYwYnwxYw|r t"||fSt"|fS)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@=s 19999 .C  4 % % dny.H  El c9 % % #,$*>*> E v~~ 3;;DS\DDDEE ET  u D$ JJ #v': : : D+t , , ;FGG Gxzz     4d + + @5S\55.35566<@ @ =DD   DDD    $tT))t##s6"C446E+D32E3 E?EEEEc|j|g|RSrr#)r%r=s r __newobj__rChs 3;s "T " " ""rc$|j|g|Ri|S)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with keyword-only arguments to be pickled correctly. rB)r%r=kwargss r __newobj_ex__rFks& 3;s ,T , , ,V , ,,rc$|jd}||Sg}t|dsn|jD]}d|jvr|jd}t |t r|f}|D]}|dvr|drb|dsM|j d}|r| d||h| |~| | ||_ n#YnxYw|S)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__Nr,)r9 __weakref_____) r9getr/r.r1str startswithendswithr4lstripappendrH)r%namesrslotsnamestrippeds r _slotnamesrVqsU L  _ - -E   E 3 $ $+  + +Aaj(( ;/eS))%"HE! + +D::: ..+t}}T7J7J+#$:#4#4S#9#9#/!LLLHHdd)CDDDD!LL.... T**** !   Ls D D ct|}d|cxkrdksntd||f}t||kr t||krdS|tvr td|dt||tvr td|dt||t|<|t|<dS) 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_registryrL_inverted_registrymodulerTcodekeys rrrs t99D  " " " " " " " ",--- 4.C$$,,t$$++ !!!j##23779:: : !!!j$$ 24 8 8:;; ;#"trc||f}t||kst||krtd|d|t|=t|=|tvr t|=dSdS)z0Unregister an extension code. For testing only.rYz is not registered with code N)r\rLr]r[_extension_cacher^s rrrs 4.C$$,,t$$++j##tt%&& &C 4   T " " " rc8tdSr)rcclearrrrrsrr)__doc____all__r rrrr NameErrorr!r6rZrMr(r0r#r2r@rCrFrVr\r]rcrrrrfrrrjs  I I I$$$$999 - G ))) F7NG,,,,   D :::ttC#I %%%  D   '$'$'$V###--- 111x###$ # # #s $,,