Your IP : 18.119.118.237


Current Path : /opt/alt/python37/lib/python3.7/site-packages/attr/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/attr/__pycache__/_compat.cpython-37.pyc

B

�:`��@s$ddlmZmZmZddlZddlZddlZddlZejddkZ	e�
�dkZesdejdd�dkrjeZ
nddlmZeZ
e	r�ddlmZmZddlmZd	d
�Zdd�Zd
Zdd�ZGdd�de�Zdd�Zdd�Zn:ddlmZmZdd�Zdd
�ZdZdd�ZejZdd�Zdd�Ze�ZdS)�)�absolute_import�division�print_functionN��PyPy)��)�OrderedDict)�Mapping�Sequence)�IterableUserDictcCst|ttjf�S)N)�
isinstance�type�typesZ	ClassType)�klass�r�=/opt/alt/python37/lib/python3.7/site-packages/attr/_compat.py�isclasssrcCsi}||�t|||�S)zP
        A minimal stub of types.new_class that we need for make_class.
        )r)�name�bases�kwds�	exec_body�nsrrr�	new_classsrrcCs|��S)N)�	iteritems)�drrrr+src@sTeZdZdZdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	ddd�Z
dd�Zd
S)�ReadOnlyDictz5
        Best-effort read-only dict wrapper.
        cCstd��dS)Nz6'mappingproxy' object does not support item assignment)�	TypeError)�self�key�valrrr�__setitem__4szReadOnlyDict.__setitem__cCstd��dS)Nz/'mappingproxy' object has no attribute 'update')�AttributeError)r�_rrr�update:szReadOnlyDict.updatecCstd��dS)Nz4'mappingproxy' object does not support item deletion)r)rr#rrr�__delitem__@szReadOnlyDict.__delitem__cCstd��dS)Nz.'mappingproxy' object has no attribute 'clear')r")rrrr�clearFszReadOnlyDict.clearNcCstd��dS)Nz,'mappingproxy' object has no attribute 'pop')r")rr�defaultrrr�popLszReadOnlyDict.popcCstd��dS)Nz0'mappingproxy' object has no attribute 'popitem')r")rrrr�popitemRszReadOnlyDict.popitemcCstd��dS)Nz3'mappingproxy' object has no attribute 'setdefault')r")rrr'rrr�
setdefaultXszReadOnlyDict.setdefaultcCsdt|j�dS)Nz
mappingproxy(�))�repr�data)rrrr�__repr__^szReadOnlyDict.__repr__)N)N)�__name__�
__module__�__qualname__�__doc__r!r$r%r&r(r)r*r.rrrrr/s

rcCst�}|j�|�|S)N)rr-r$)r�resrrr�metadata_proxybsr4cOsdS)z�
        We only warn on Python 3 because we are not aware of any concrete
        consequences of not setting the cell on Python 2.
        Nr)�args�kwrrr�	just_warngsr7cOstjdtdd�dS)z�
        We only warn on Python 3 because we are not aware of any concrete
        consequences of not setting the cell on Python 2.
        z�Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted classes.r)�
stacklevelN)�warnings�warn�RuntimeWarning)r5r6rrrr7qscCs
t|t�S)N)r
r)rrrrr~s�classcCs|��S)N)�items)rrrrr�scCst�t|��S)N)r�MappingProxyType�dict)rrrrr4�scs0trdd�}|Sdd�}y�tr&|j}n|j}|jdks@|jdkrDt�tjdkrb|j	|j|jd��n`|j
g}tsz|�|j�|�
|j|j|j|j|j|j|j|j|j|j|j|j|jg
�tj|���fd	d�}d
d�}tr�|�jd}n|�jd}||d
�|jd
k�rt�Wntk
�r&tSX|SdS)z|Return a function of two arguments (cell, value) which sets
    the value stored in the closure cell `cell` to `value`.
    cSs|�|f�dS)N)�__setstate__)�cell�valuerrr�set_closure_cell�sz/make_set_closure_cell.<locals>.set_closure_cellcs|�dS)Ncs�S)Nrr)�xrr�force_x_to_be_a_cell�szQmake_set_closure_cell.<locals>.set_first_cellvar_to.<locals>.force_x_to_be_a_cellr)rBrEr)rDr�set_first_cellvar_to�sz3make_set_closure_cell.<locals>.set_first_cellvar_to)rDr)r�)�co_cellvars�co_freevarscs t��idd|f�}||�dS)N�setterr)r�FunctionType)rArBrJ)�set_first_freevar_coderrrC�scsd��fdd�}|S)Ncs�S)Nrr)rDrr�func�sz@make_set_closure_cell.<locals>.make_func_with_cell.<locals>.funcr)rMr)rDr�make_func_with_cell�sz2make_set_closure_cell.<locals>.make_func_with_cellr�dN) �PYPY�PY2�	func_code�__code__rHrI�AssertionError�sys�version_info�replace�co_argcount�append�co_kwonlyargcount�extend�
co_nlocals�co_stacksize�co_flags�co_code�	co_consts�co_names�co_varnames�co_filename�co_name�co_firstlineno�	co_lnotabr�CodeTypeZfunc_closure�__closure__�
cell_contents�	Exceptionr7)rCrF�cor5rNrAr)rLr�make_set_closure_cell�sT




rl)�
__future__rrr�platformrUrr9rVrQ�python_implementationrPr?Zordered_dict�collectionsr	r
r�UserDictrrrZTYPErrr4r7�collections.abcrlrCrrrr�<module>s:
3

f

?>