Files
952-11/env/python/dll/Python312/Lib/__pycache__/copy.cpython-312.pyc
T

119 lines
9.6 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åf"ãób—dZddlZddlZddlmZGd„de«ZeZgd¢Zd„Z ixZ
Z d„Z ejeeeeeeeeeeeeej4ej6ej8ej:ej<ej>fD]Z e e e <Œ e!je e!<e"je e"<e#je e#<e$je e$<[ [ dgfd „Z%ixZ&Z d
„Z'e'e ej<e'e ej6<e'e ej8<e'e e<e'e e<e'e e<e'e e<e'e e<e'e e<e'e ej<<e'e e<e'e e<e'e ej4<e'e ej:<e'e ej><e'e e<e%fd „Z(e(e e!<e%fd „Z)e)e e<e%fd
„Z*e*e e"<d„Z+e+e ejX<[ d„Z- de%dœd„Z.[[y)aÂGeneric (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relevant for
compound objects (objects that contain other objects, like lists or
class instances).
- A shallow copy constructs a new compound object and then (to the
extent possible) inserts *the same objects* into it that the
original contains.
- A deep copy constructs a new compound object and then, recursively,
inserts *copies* into it of the objects found in the original.
Two problems often exist with deep copy operations that don't exist
with shallow copy operations:
a) recursive objects (compound objects that, directly or indirectly,
contain a reference to themselves) may cause a recursive loop
b) because deep copy copies *everything* it may copy too much, e.g.
administrative data structures that should be shared even between
copies
Python's deep copy operation avoids these problems by:
a) keeping a table of objects already copied during the current
copying pass
b) letting user-defined classes override the copying operation or the
set of components copied
This version does not copy types like module, class, function, method,
nor stack trace, stack frame, nor file, socket, window, nor any
similar types.
Classes can use the same interfaces to control copying that they use
to control pickling: they can define methods called __getinitargs__(),
__getstate__() and __setstate__(). See the documentation for module
"pickle" for information on these methods.
éN)Údispatch_tablecó —eZdZy)ÚErrorN)Ú__name__Ú
__module__Ú __qualname__©óú@C:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\copy.pyrr7s„Ør
r)rÚcopyÚdeepcopycó²—t|«}tj|«}|r||«St|t«r t |«St |dd«}|�||«St
j|«}|� ||«}n=t |dd«}|� |d«}n%t |dd«}|r|«}ntd|z«‚t|t«r|St|dg|¢­ŽS)zlShallow copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
Ú__copy__NÚ
__reduce_ex__éÚ
__reduce__z%un(shallow)copyable object of type %s) ÚtypeÚ_copy_dispatchÚgetÚ
issubclassÚ_copy_immutableÚgetattrrrÚ
isinstanceÚstrÚ _reconstruct)ÚxÚclsÚcopierÚreductorÚrvs r r r =sã€ô ˆq‹'€Cä
×
Ñ
 Ó
$€FÙ
Ù�a‹yÐä�#”tÔä˜qÓ!Ð!ä
�S˜* dÓ
+€FØ
ÐÙ�a‹yÐä×!Ñ! #Ó&€HØÐÙ
�a‹[‰ä˜1˜o¨tÓ4ˆØ Ð Ù˜!“‰Bä˜q ,°Ó5ˆHÙÙ“Z‘äÐCÀcÑIÓJÐJä�"”cÔØˆÜ ˜˜4Ð % "Ò %Ð%r
có—|S©Nr )rs r rrfó€Ø €Hr
có:—|€i}t|«}|j||«}||ur|St|«}tj|«}|�
|||«}n²t |t«r
t ||«}n•t
|dd«}|� ||«}n}tj|«}|r ||«}n=t
|dd«}|� |d«}n%t
|dd«}|r|«}ntd|z«‚t|t«r|}n
t||g|¢­Ž}||ur|||<t||«|S)ziDeep copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
NÚ __deepcopy__rrrz"un(deep)copyable object of type %s)
ÚidrrÚ_deepcopy_dispatchrÚ_deepcopy_atomicrrrrrrÚ _keep_alive) rÚmemoÚ_nilÚdÚyrrrr s r r
r
vs9€ð  €|؈ä
ˆ1‹€AØ �‰��DÓ€AØ��}؈ä
ˆq‹'€Cä
×
#Ñ
# CÓ
(€FØ
ÐÙ �1�d‹O‰ä �cœ4Ô Ü   DÓ)‰Aä˜Q °Ó5ˆFØÐ!Ù˜4“L‘ä)×-Ñ-¨cÓ2�ÙÙ! !›‘Bä& q¨/¸4Ó@�HØÐ+Ù% a›[™ä#*¨1¨l¸DÓ#A˜Ù#Ù!)£™Bä"'Ø DÀsÑ Jó#LðLä˜b¤#Ô&Ø‘Aä$ Q¨Ð2¨rÒ2�Að ��z؈ˆQ‰Ü�A�tÔØ €Hr
có—|Sr"r ©rr*s r r(r(¬r#r
cój—g}||t|«<|j}|D]}||||««Œ|Sr")r&Úappend)rr*r
r-r1Úas r Ú_deepcopy_listr3¿s@€Ø
€AØ€DŒˆA‹�KØ
�X‰X€FØ
ò"ˆÙ‰x˜˜4Ó Õ!ð"à €Hr
cóÈ—|D�cgc] }|||«‘Œ
}} |t|«Scc}w#t$rYnwxYwt||«D]\}}||usŒ t|«}|S|}|Sr")r&ÚKeyErrorÚzipÚtuple)rr*r
r2r-ÚkÚjs r Ú_deepcopy_tupler:Ès‡€Ø$%Ö&˜q‰�!�TÕ Ð&€AÐ&ð
Ø”B�q“E‰{Ðùò 'øô
ò
Ù ð
úä�A�q“ ò‰ˆˆ1Ø �AŠ:Ü�a“ˆAØ ð
€Hð
ð
ˆØ €Hs…&˜
+« 77có|—i}||t|«<|j«D]\}}|||«||||«<Œ|Sr")r&Úitems)rr*r
r-ÚkeyÚvalues r Ú_deepcopy_dictr?ÙsJ€Ø
€AØ€DŒˆA‹�KØ—g‘g“iò7‰
ˆˆUÙ!)¨%°Ó!6ˆ‰(�3˜Ó
Òð7à €Hr
cób—t|«|jt|j|««Sr")rÚ__func__r
Ú__self__r/s r Ú_deepcopy_methodrCás$€Ø Œ4�‹7�1—:‘:œx¨¯
©
°DÓ9Ó :Ð:r