tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
L\¬Qc@s›dZddlZddlZddlmZdefd„ƒYZeZyddlm    Z    Wne
k
rwdZ    nXdddgZ d    „Z iZZd
„Zx]edƒeeeeeeeeeejejeeƒejejfD]Zeee<qïWx9dD]1Z e!ee dƒZedk    r
eee<q
q
Wd„Z"x!e#e$e%fD]Ze"ee<qXWd„Z&e    dk    rŽe&ee    <nd„Z'e'eej(<[dgd„Z)iZ*Zd„Z+e+eedƒ<e+eeeƒ<e+ee<e+ee<e+ee<e+ee<ye+ee,<Wne-k
r2nXe+ee<ye+ee.<Wne-k
r^nXye+eej/<Wne0k
rƒnXe+ee<e+ee<e+eej<e+eej<e+eej<e+eej<d„Z1e1ee#<d„Z2e2ee<d„Z3e3ee$<e    dk    re3ee    <nd„Z4e4e*ej5<d„Z6d„Z7e7eej(<dd„Z8[[ddd„ƒYZ9d„Z:e;dkr—e:ƒndS( sÍ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 array, 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.
iÿÿÿÿN(tdispatch_tabletErrorcBseZRS((t__name__t
__module__(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR7s(t PyStringMaptcopytdeepcopycCsÜt|ƒ}tj|ƒ}|r+||ƒSt|ddƒ}|rM||ƒStj|ƒ}|rq||ƒ}n[t|ddƒ}|r˜|dƒ}n4t|ddƒ}|r¼|ƒ}ntd|ƒ‚t||dƒS(slShallow copy operation on arbitrary Python objects.
 
    See the module's __doc__ string for more info.
    t__copy__t __reduce_ex__it
__reduce__s%un(shallow)copyable object of type %siN(ttypet_copy_dispatchtgettgetattrtNoneRRt _reconstruct(txtclstcopiertreductortrv((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyRBs$ 
 
 cCs|S(N((R((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_copy_immutableest ComplexTypet UnicodeTypetCodeTypecCst|ƒ|ƒS(N(R
(R((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_copy_with_constructorqscCs
|jƒS(N(R(R((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_copy_with_copy_methodvscCsµt|dƒr|jƒSt|dƒrF|jƒ}|j|Œ}ntƒ}|j|_t|dƒry|jƒ}n    |j}t|dƒr¡|j|ƒn|jj|ƒ|S(NRt__getinitargs__t __getstate__t __setstate__(    thasattrRRt    __class__t _EmptyClassRt__dict__Rtupdate(Rtargstytstate((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt
_copy_inst{s
          c
Cs‘|dkri}nt|ƒ}|j||ƒ}||k    rC|St|ƒ}tj|ƒ}|rv|||ƒ}nyt|tƒ}Wntk
r¢d}nX|r»t||ƒ}n»t|ddƒ}|râ||ƒ}n”t    j|ƒ}|r||ƒ}    n[t|ddƒ}|r-|dƒ}    n4t|ddƒ}|rQ|ƒ}    nt
d|ƒ‚t ||    d|ƒ}|||<t ||ƒ|S(    siDeep copy operation on arbitrary Python objects.
 
    See the module's __doc__ string for more info.
    it __deepcopy__RiR    s"un(deep)copyable object of type %siN( RtidR R
t_deepcopy_dispatcht
issubclasst    TypeErrort_deepcopy_atomicR RRRt _keep_alive(
Rtmemot_niltdR$RRtisscRR((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR‘sD         
 
 cCs|S(N((RR.((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR,ÆscCsAg}||t|ƒ<x$|D]}|jt||ƒƒqW|S(N(R(tappendR(RR.R$ta((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_deepcopy_listâs
 cCs®g}x$|D]}|jt||ƒƒq Wt|ƒ}y ||SWntk
rXnXxDtt|ƒƒD]*}||||k    rlt|ƒ}PqlqlW|}|||<|S(N(R2RR(tKeyErrortrangetlenttuple(RR.R$R3R0ti((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_deepcopy_tupleês     
cCsSi}||t|ƒ<x6|jƒD](\}}t||ƒ|t||ƒ<q#W|S(N(R(t    iteritemsR(RR.R$tkeytvalue((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_deepcopy_dictýs
 cCs(t|ƒ|jt|j|ƒ|jƒS(N(R
tim_funcRtim_selftim_class(RR.((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_deepcopy_methodscCsFy|t|ƒj|ƒWn$tk
rA|g|t|ƒ<nXdS(sMKeeps a reference to the object x in the memo.
 
    Because we remember objects by their id, we have
    to assure that possibly temporary objects are kept
    alive by referencing them.
    We store a reference at the id of the memo, which should
    normally not be used unless someone tries to deepcopy
    the memo itself...
    N(R(R2R5(RR.((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR- s
 cCsæt|dƒr|j|ƒSt|dƒrX|jƒ}t||ƒ}|j|Œ}ntƒ}|j|_||t|ƒ<t|dƒr›|jƒ}n    |j}t||ƒ}t|dƒrÒ|j    |ƒn|jj
|ƒ|S(NR'RRR( RR'RRRR R(RR!RR"(RR.R#R$R%((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_deepcopy_insts"           cCsFt|tƒr|S|dkr(i}nt|ƒ}|d \}}|dkr]|d}ni}|dkr||d}nd}|dkr›|d}    nd}    |r¹t||ƒ}n||Œ}
|
|t|ƒ<|r¦|rót||ƒ}nt|
dƒr|
j|ƒq¦t|tƒrBt|ƒdkrB|\}} nd} |dk    rg|
j    j
|ƒn| dk    r¦x-| j ƒD]\} } t |
| | ƒq€Wq¦n|dk    rëx6|D]+}|r×t||ƒ}n|
j |ƒq¹Wn|    dk    rBxH|    D]=\} } |r1t| |ƒ} t| |ƒ} n| |
| <qþWn|
S(NiiiR(t
isinstancetstrRR7RR(RRR8R!R"R;tsetattrR2(RtinfotdeepR.tntcallableR#R%tlistitertdictiterR$t    slotstateR<R=titem((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR2sX             !     R cBseZRS((RR(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR nsc
Cs    ddddddddgidd6dgig }t|ƒ}||kGHtt|ƒ}||kGHt|ƒ}||kGHddd„ƒY}|d    ƒ}|j|ƒt|ƒ}||kGH|GH|GHt|ƒ}||kGH|GH|GH|ji||d6|d
d 6ƒt|ƒ}d dl}t|j|ƒGHt|j|ƒGHt|j|ƒGHt|j|ƒGHt|ƒ}d dl}t|j|ƒGHt|j|ƒGHt|j|ƒGHt|j|ƒGHd tfd„ƒY}|idd6ƒ}t|ƒ}    ||    fGHdS(Nilg…ëQ¸    @txyzzytabctABCtCcBs2eZdd„Zd„Zd„Zdd„ZRS(cSs`d|_||_tdkr:ddl}|jd}nt}t|ƒ|_|jjƒdS(Nit__main__iÿÿÿÿi(    R3targRtsystargvt__file__topentfptclose(tselfRTRUtfile((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt__init__{s          cSsi|jd6|jd6S(NR3RT(R3RT(R[((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR…scSs1x*|jƒD]\}}t|||ƒq WdS(N(R;RF(R[R%R<R=((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR‡scSs+|jt|j|ƒƒ}|j|_|S(N(RRRTR3(R[R.tnew((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR'Šs N(RRRR]RRR'(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyRRzs
       sargument sketchitxyziÿÿÿÿtodictcBseZid„Zd„ZRS(cSsd|_tj||ƒdS(Nic(R3tdictR](R[R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR]¦s    cSstj|||ƒ|jdS(N(Rat __setitem__R3(R[tkR9((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyRb©s(RRR]Rb(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyR`¥s tBtA(il(((RRtmapRR2treprRa(
tltl1RRtctl2tl3RgR`toR((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt_testqsH           #     RS(s ComplexTypes UnicodeTypesCodeType((<t__doc__ttypestweakreftcopy_regRt    ExceptionRterrortorg.python.coreRt ImportErrorRt__all__RR R0RR
tinttlongtfloattboolRER8t    frozensettxranget    ClassTypetBuiltinFunctionTypetEllipsist FunctionTypetreftttnameR RtlistRatsetRR&t InstanceTypeRR)R,tcomplext    NameErrortunicodeRtAttributeErrorR4R:R>RBt
MethodTypeR-RCRR RnR(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy.pyt<module>1sž   
    !
                     3
    
 
 
 
 
 
 
        
    
    
                 7    ?