Your IP : 13.59.36.36


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/copyreg.cpython-310.opt-1.pyc

o

6��f�@s�dZgd�ZiZddd�Zdd�ZzeWn	eyYnwdd�Zeeee�d	d
�Zee	e
eB�e�dd�Zd
Z
e	e
j�Zdd�Zdd�Zdd�Zdd�ZiZiZiZdd�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_cacheNcCs0t|�std��|t|<|durt|�dSdS)Nz$reduction functions must be callable)�callable�	TypeError�dispatch_tabler)�ob_type�pickle_function�constructor_ob�r�./opt/alt/python310/lib64/python3.10/copyreg.pyrs�rcCst|�std��dS)Nzconstructors must be callable)rr)�objectrrr
rs�rcCst|j|jffS�N)�complex�real�imag)�crrr
�pickle_complex"srcCs"ddl}ddl}|j|j|jffS)N�)�	functools�operator�reduce�or_�__args__)�objrrrrr
�pickle_union'srcCs>|turt�|�}|S|�||�}|jtjkr|�||�|Sr)r�__new__�__init__)�cls�base�staterrrr
�_reconstructor/s
�r"ic	Cs|j}|jD]}t|d�r|jt@sn|j}t|t�r#|j|ur#nqt	}|t	ur-d}n||ur:t
d|j�d���||�}|||f}z|j}Wn,t
ytt|dd�rat
d|j�d|���d�z|j}Wnt
yqd}YnwYnw|�}|rt||fSt|fS)N�	__flags__zcannot pickle z object�	__slots__zf object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol )�	__class__�__mro__�hasattrr#�	_HEAPTYPEr�
isinstance�	_new_type�__self__rr�__name__�__getstate__�AttributeError�getattr�__dict__r")	�self�protorr �newr!�args�getstate�dictrrr
�
_reduce_ex=sF
�

��
���
r7cGs|j|g|�R�Sr�r)rr4rrr
�
__newobj__dsr9cCs|j|g|�Ri|��S)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with
    keyword-only arguments to be pickled correctly.
    r8)rr4�kwargsrrr
�
__newobj_ex__gsr;cCs�|j�d�}|dur|Sg}t|d�snI|jD]E}d|jvr\|jd}t|t�r+|f}|D].}|dvr4q-|�d�rV|�d�sV|j�	d�}|rP|�
d||f�q-|�
|�q-|�
|�q-qz||_W|SY|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__Nr$)r0�__weakref__�__�_z_%s%s)r0�getr'r&r)�str�
startswith�endswithr,�lstrip�appendr<)r�namesr�slots�name�strippedrrr
�
_slotnamesms6




��rJcCs�t|�}d|krdkstd��td��||f}t�|�|kr*t�|�|kr*dS|tvr8td|t|f��|tvrFtd|t|f��|t|<|t|<dS)zRegister an extension code.�i���zcode out of rangeNz)key %s is already registered with code %sz$code %s is already in use for key %s)�int�
ValueError�_extension_registryr@�_inverted_registry��modulerH�code�keyrrr
r�s&�
�
�rcCsV||f}t�|�|kst�|�|krtd||f��t|=t|=|tvr)t|=dSdS)z0Unregister an extension code.  For testing only.z%key %s is not registered with code %sN)rNr@rOrM�_extension_cacherPrrr
r�s�
�rcCst��dSr)rT�clearrrrr
r�srr)�__doc__�__all__rrrr�	NameErrorrr�typerLrAr"r(rr*r7r9r;rJrNrOrTrrrrrrr
�<module>s6

�	
'<

?>