Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
copy.cpython-314.pyc118 linesDownload Raw Back to __pycache__
1+
2��i�!��b�Rt^RIt^RIt^RIHt!RR]4t]t.ROtRt	]P]]]
]]]]]]]]]]P.]P0]P2]P4]P6]P8]0t]] ]!]"0t#R.3Rlt$]P]P0]P2]]]
]]]]P6]]]P.]P4]P8]0t%/;t&t']$3Rlt(](]']&]$3R	lt)])]']&]$3R3lt*]*]'] &Rt+]+]']PX&A'Rt-RR]$/R
llt.AARt/R#)a9Generic (shallow and deep) copying operations.4 5Interface summary:6 7        import copy8 9        x = copy.copy(y)                # make a shallow copy of y10        x = copy.deepcopy(y)            # make a deep copy of y11        x = copy.replace(y, a=1, b=2)   # new object with fields replaced, as defined by `__replace__`12 13For module specific errors, copy.Error is raised.14 15The difference between shallow and deep copying is only relevant for16compound objects (objects that contain other objects, like lists or17class instances).18 19- A shallow copy constructs a new compound object and then (to the20  extent possible) inserts *the same objects* into it that the21  original contains.22 23- A deep copy constructs a new compound object and then, recursively,24  inserts *copies* into it of the objects found in the original.25 26Two problems often exist with deep copy operations that don't exist27with shallow copy operations:28 29 a) recursive objects (compound objects that, directly or indirectly,30    contain a reference to themselves) may cause a recursive loop31 32 b) because deep copy copies *everything* it may copy too much, e.g.33    administrative data structures that should be shared even between34    copies35 36Python's deep copy operation avoids these problems by:37 38 a) keeping a table of objects already copied during the current39    copying pass40 41 b) letting user-defined classes override the copying operation or the42    set of components copied43 44This version does not copy types like module, class, function, method,45nor stack trace, stack frame, nor file, socket, window, nor any46similar types.47 48Classes can use the same interfaces to control copying that they use49to control pickling: they can define methods called __getinitargs__(),50__getstate__() and __setstate__().  See the documentation for module51"pickle" for information on these methods.52N)�dispatch_tablec��]tRt^8tRtR#)�Error�N)�__name__�53__module__�__qualname__�__firstlineno__�__static_attributes__r��Lib\copy.pyrr8s��rr�deepcopyc���\V4pV\9dV#V\9dVPV4#\	V\4'dV#\VRR4pVe	V!V4#\P!V4pVe54V!V4pMI\VRR4pVe55V!^4pM/\VRR4pV'd	V!4pM\RV,4h\V\4'dV#\VR.VO5!#)zdShallow copy operation on arbitrary Python objects.56 57See the module's __doc__ string for more info.58�__copy__N�
__reduce_ex__�59__reduce__z%un(shallow)copyable object of type %s)�type�_copy_atomic_types�_copy_builtin_containers�copy�60issubclass�getattrr�getr�61isinstance�str�_reconstruct)�x�cls�copier�reductor�rvs&    rrr>s����q�'�C�62� � ���63�&�&��x�x��{���#�t�����
�S�*�d�
+�F�
���a�y���!�!�#�&�H���
�a�[���1�o�t�4�����!��B��q�,��5�H���Z���C�c�I�J�J��"�c�������4�%�"�%�%rc��\V4pV\9dV#\V4pVf/pMVPWB4pWRJdV#\PV4pVe64V!W4pM�\V\4'dTpM�\
VRR4pVe65V!V4pM�\P!V4pV'd66V!V4pMI\
VRR4pVe67V!^4pM/\
VRR4pV'd	V!4pM\RV,4h\V\4'dTpM
\W.VO5!pWPJdWQV&\W4V#)zaDeep copy operation on arbitrary Python objects.68 69See the module's __doc__ string for more info.70N�__deepcopy__rrz"un(deep)copyable object of type %s)
r�
_atomic_types�idr�_deepcopy_dispatchrrrrrrr�_keep_alive)	r�memo�_nilr�d�yrrr s	&&&      rr
r
ns7���q�'�C�71�m����72�1��A��|����H�H�Q����=��H�
�
#�
#�C�
(�F�
���1�O���c�4� � ��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���Hrc�j�.pW1\V4&VPpVFpV!V!WQ44K	V#�N)r$�append)rr'r
r*r-�as&&&   r�_deepcopy_listr/�s7��73�A���A��K�
�X�X�F�
���x�� �!���Hrc���VUu.uF74q2!W14NK	ppV\V4,#uupi \dMi;i\Y4FwrVYVJgK\T4pT#	TpT#r,)r$�KeyError�zip�tuple)rr'r
r.r*�k�js&&&    r�_deepcopy_tupler6�s{��$%�&�A�q��!�	�A�A�&�
��B�q�E�{���		'��75�
��
���A�	����:��a��A��
�H�
�76
���Hs�*�/�=�=c�v�/pW1\V4&VP4FwrEV!WQ4W2!WA4&K	V#r,)r$�items)rr'r
r*�key�values&&&   r�_deepcopy_dictr;�s=��77�A���A��K��g�g�i�78��!)�%�!6��(�3�79�� ��Hrc�b�\V4!VP\VPV44#r,)r�__func__r
�__self__�rr's&&r�_deepcopy_methodr@�s"����7�1�:�:�x��80�81�D�9�:�:rc��V\V4,PV4R# \dT.T\T4&R#i;i)a1Keeps a reference to the object x in the memo.82 83Because we remember objects by their id, we have84to assure that possibly temporary objects are kept85alive by referencing them.86We store a reference at the id of the memo, which should87normally not be used unless someone tries to deepcopy88the memo itself...89N)r$r-r1r?s&&rr&r&�s;����R��X����a� �����s��R��X���s�!%�A�Ac��aa�SRJpV'dV'dVV3RlV4pV!V!p	V'dV	S\V4&Ve�V'd90S!VS4p\V	R4'dV	PV4Mu\V\4'd\V4^8XdVwrJMRp91VeV	PPV4V92e&V93P4Fwr�\W�V4K	VeGV'd%VFp
S!V
S4p
V	PV
4K	MVFp
V	PV
4K	Ve;V'd$VFwr�S!VS4pS!VS4pW�V&K	V	#VF	wr�W�V&K	V	#)Nc3�6<"�TFpS!VS4x�K	R#5ir,r)�.0�argr
r's& ��r�	<genexpr>�_reconstruct.<locals>.<genexpr>�s����4�t����d�#�#�t�s��__setstate__)r$�hasattrrHrr3�len�__dict__�updater8�setattrr-)rr'�func�args�state�listiter�dictiterr
�deepr*�	slotstater9r:�items&f&&&&&d      rrr�s^����t��D���4�t�4���d��A����R��U������U�D�)�E��1�n�%�%�
�N�N�5�!��%��'�'�C��J�!�O�#(� ��y� �	�� ��94�95�!�!�%�(��$�"+�/�/�"3�J�C��A�E�*�#4���� ����d�+�������!�!�������!����&�96���s�D�)�� ���-���#��'�
�H�'�97���#��'��Hrc��VPp\VRR4pVf\RVPR24hV!V3/VB#)z�Return a new object replacing specified fields with new values.98 99This is especially useful for immutable objects, like named tuples or100frozen dataclasses.101�__replace__Nzreplace() does not support z objects)�	__class__r�	TypeErrorr)�obj�changesrrNs",  r�replacer\sI���-�-�C��3�
�t�,�D��|��5�c�l�l�^�8�L�M�M����w��r)rrr
r\)NNN)0�__doc__�types�weakref�copyregr�	Exceptionr�error�__all__r�NoneType�int�float�bool�complexrr3�bytes�	frozensetr�range�slice�property�BuiltinFunctionType�EllipsisType�NotImplementedType�FunctionType�CodeType�ref�superr�list�dict�set�	bytearrayrr
r#r%r)r/r6r;r@�102MethodTyper&rr\rrr�<module>rzsy��1�f
��"�	�I�	�
��1032��&&�R�n�n�c�5�$���e�104��D�%���105�106#�107#�U�%7�%7�108�109"�110"�E�$6�$6����111�+�+�u�	��112!�$��Y�7����5
�n�.�.�%�"4�"4�e�6N�6N�113
�u�d�G�U�C�����u�114�115#�116#�U�%7�%7����h�P�
����Q�&.�
���$��&.�
���%��%-�
���$��;�&��%������ +
�%�+
�Z117�7�118 r
codekingpro/portable-devtools · Team Ai