AlkantarClanX12

Your IP : 3.141.29.162


Current Path : /opt/alt/python34/lib64/python3.4/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/__pycache__/copy.cpython-34.pyo

�
e f-#�@sydZddlZddlZddlmZddlZGdd�de�ZeZyddl	m
Z
Wnek
r�dZ
YnXdddgZd	d�Z
iZZd
d�ZxWed�eeeeeeeeeejee�ejejfD]Zeee<q�Weedd�Zedk	r;eee<nx9d$D]1Z eee d�Zedk	rBeee<qBqBWdd�Z!x!e"e#e$fD]Ze!ee<q�Wdd�Z%e
dk	r�e%ee
<n[dgdd�Z&iZ'Zdd�Z(e(eed�<e(eee�<e(ee<e(ee<e(ee<ye(ee)<Wne*k
rWYnXe(ee<e(ee<ye(eej+<Wne,k
r�YnXe(ee<e(ee<e(eej<e(eej<e(eej<dd�Z-e-ee"<dd�Z.e.ee<dd�Z/e/ee#<e
dk	r(e/ee
<ndd�Z0e0e'ej1<dd�Z2dd d!�Z3[[Gd"d#�d#�Z4dS)%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 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.
�N)�dispatch_tablec@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�)/opt/alt/python34/lib64/python3.4/copy.pyr8sr)�PyStringMap�copy�deepcopycCst|�}tj|�}|r+||�Syt|t�}Wntk
rXd}YnX|rit|�St|dd�}|r�||�Stj|�}|r�||�}n[t|dd�}|r�|d�}n4t|dd�}|r�|�}ntd|��t	||d�S)	zlShallow copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    F�__copy__N�
__reduce_ex__��
__reduce__z%un(shallow)copyable object of type %sr)
�type�_copy_dispatch�get�
issubclass�	TypeError�_copy_immutable�getattrrr�_reconstruct)�x�cls�copier�issc�reductor�rvrrrr
Cs0



cCs|S)Nr)rrrrrnsr�CodeType�complex�unicodecCst|�|�S)N)r)rrrr�_copy_with_constructor}sr!cCs
|j�S)N)r
)rrrr�_copy_with_copy_method�sr"c

Cs�|dkri}nt|�}|j||�}||k	rC|St|�}tj|�}|rv|||�}nyt|t�}Wntk
r�d}YnX|r�t||�}n�t|dd�}|r�||�}n�tj|�}|r||�}	n[t|dd�}|r.|d�}	n4t|dd�}|rR|�}	nt	d|��t
||	d|�}||k	r�|||<t||�n|S)	ziDeep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    Nr�__deepcopy__r
rrz"un(deep)copyable object of type %s�)�idrr�_deepcopy_dispatchrr�_deepcopy_atomicrrrr�_keep_alive)
r�memoZ_nil�d�yrrrrrrrrr�sF	


cCs|S)Nr)rr)rrrr'�sr'cCsAg}||t|�<x$|D]}|jt||��qW|S)N)r%�appendr)rr)r+�arrr�_deepcopy_list�s

r.cCs�g}x$|D]}|jt||��q
Wy|t|�SWntk
rSYnXxDtt|��D]*}||||k	rgt|�}PqgqgW|}|S)N)r,rr%�KeyError�range�len�tuple)rr)r+r-�irrr�_deepcopy_tuple�s

r4cCsSi}||t|�<x6|j�D](\}}t||�|t||�<q#W|S)N)r%�itemsr)rr)r+�key�valuerrr�_deepcopy_dict�s
 r8cCs"t|�|jt|j|��S)N)r�__func__r�__self__)rr)rrr�_deepcopy_method�sr;cCsGy|t|�j|�Wn%tk
rB|g|t|�<YnXdS)aMKeeps 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%r,r/)rr)rrrr(s

r(cCsRt|t�r|S|dkr(i}nt|�}|dd�\}}|dkrc|d}nd}|dkr�|d}nd}|dkr�|d}	nd}	|r�t||�}n||�}
|
|t|�<|dk	r�|r�t||�}nt|
d�r|
j|�q�t|t�rNt|�dkrN|\}}nd}|dk	rs|
jj	|�n|dk	r�x-|j
�D]\}}
t|
||
�q�Wq�n|dk	r�x6|D]+}|r�t||�}n|
j|�q�Wn|	dk	rNxH|	D]=\}}
|r=t||�}t|
|�}
n|
|
|<q
Wn|
S)Nr���__setstate__)
�
isinstance�strr1rr%�hasattrr>r2�__dict__�updater5�setattrr,)r�infoZdeepr)�n�callable�args�stateZlistiterZdictiterr+Z	slotstater6r7�itemrrrrsX	


!
rc@seZdZdS)�_EmptyClassN)rrrrrrrrKLsrK)zcomplexr )5�__doc__�types�weakref�copyregr�builtins�	Exceptionr�errorZorg.python.corer	�ImportError�__all__r
rr*rr�int�float�boolr@r2�bytes�	frozensetr0�BuiltinFunctionType�Ellipsis�FunctionType�ref�tr�namer!�list�dict�setr"rr&r'r�	NameErrorr�AttributeErrorr.r4r8r;�
MethodTyper(rrKrrrr�<module>1s�
)



5

















7