ზ3በંવવხްុլRxስសلçໂH℅૩/lib64/python3.6/__pycache__/
Current File : //lib64/python3.6/__pycache__/copyreg.cpython-36.pyc
3
\_�@s�dZdddddgZiZddd�Zdd�ZyeWnek
rDYnXd d
�Zeeee�dd�ZdZ dd�Z
dd�Zdd�Zdd�Z
iZiZiZdd�Zdd�Zdd�ZdS)z�Helper 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_extension�remove_extension�clear_extension_cacheNcCs,t|�std��|t|<|dk r(t|�dS)Nz$reduction functions must be callable)�callable� TypeError�dispatch_tabler)�ob_type�pickle_function�constructor_ob�r�/usr/lib64/python3.6/copyreg.pyrs
cCst|�std��dS)Nzconstructors must be callable)rr)�objectrrr
rscCst|j|jffS)N)�complex�real�imag)�crrr
�pickle_complex"srcCs<|tkrtj|�}n$|j||�}|jtjkr8|j||�|S)N)r�__new__�__init__)�cls�base�state�objrrr
�_reconstructor)sr�� cCs�|dkst�x,|jjD]}t|d�r|jt@rPqWt}|tkrHd}n ||jkr`td|j��||�}|j||f}y
|j }WnLt
k
r�t|dd�r�td��y
|j}Wnt
k
r�d}YnXYnX|�}|r�t
||fSt
|fSdS)N�� __flags__zcan't pickle %s objects� __slots__zNa class that defines __slots__ without defining __getstate__ cannot be pickled)�AssertionError� __class__�__mro__�hasattrr� _HEAPTYPErr�__name__�__getstate__�AttributeError�getattr�__dict__r)�self�protorr�args�getstate�dictrrr
�
_reduce_ex6s0
r/cGs|j|f|��S)N)r)rr,rrr
�
__newobj__Wsr0cCs|j|f|�|�S)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with
keyword-only arguments to be pickled correctly.
)r)rr,�kwargsrrr
�
__newobj_ex__Zsr2c Cs�|jjd�}|dk r|Sg}t|d�s(n�x�|jD]�}d|jkr0|jd}t|t�rX|f}xh|D]`}|d krnq^q^|jd�r�|jd�r�|jj d�}|r�|j
d||f�q�|j
|�q^|j
|�q^Wq0Wy
||_WnYnX|S)
a�Return 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__Nrr)�__weakref__�__�_z_%s%s)r)r4)r)�getr#r"�
isinstance�str�
startswith�endswithr%�lstrip�appendr3)r�namesr�slots�name�strippedrrr
�
_slotnames`s2
rBcCs�t|�}d|kodkns(td��||f}tj|�|krPtj|�|krPdS|tkrltd|t|f��|tkr�td|t|f��|t|<|t|<dS)zRegister an extension code.ri���zcode out of rangeNz)key %s is already registered with code %sz$code %s is already in use for key %s)�int�
ValueError�_extension_registryr7�_inverted_registry)�moduler@�code�keyrrr
r�scCsR||f}tj|�|ks$tj|�|kr4td||f��t|=t|=|tkrNt|=dS)z0Unregister an extension code. For testing only.z%key %s is not registered with code %sN)rEr7rFrD�_extension_cache)rGr@rHrIrrr
r�scCstj�dS)N)rJ�clearrrrr
r�s)Ni)�__doc__�__all__rrrr� NameErrorrrr$r/r0r2rBrErFrJrrrrrrr
�<module>s.
!<