Viewing File: /opt/alt/python35/lib/python3.5/site-packages/attr/__pycache__/_compat.cpython-35.opt-1.pyc



#IGZ@s:ddlmZmZmZddlZddlZddlZddlZejddkZ	ej
dkZe	rddlm
Z
ddZdZd	d
ZGddde
Zd
dZn*ddZdZdd
ZddZddZe	sddZnddZddZeZdS))absolute_importdivisionprint_functionNZPyPy)IterableUserDictcCst|ttjfS)N)
isinstancetypetypesZ	ClassType)klassr/_compat.pyisclasssr
rcCs
|jS)N)	iteritems)drrrrsrc@s|eZdZdZddZddZddZdd	Zd
ddZd
dZ	d
ddZ
ddZd
S)ReadOnlyDictz5
        Best-effort read-only dict wrapper.
        cCstddS)Nz6'mappingproxy' object does not support item assignment)	TypeError)selfkeyvalrrr__setitem__!szReadOnlyDict.__setitem__cCstddS)Nz/'mappingproxy' object has no attribute 'update')AttributeError)r_rrrupdate&szReadOnlyDict.updatecCstddS)Nz4'mappingproxy' object does not support item deletion)r)rrrrr__delitem__+szReadOnlyDict.__delitem__cCstddS)Nz.'mappingproxy' object has no attribute 'clear')r)rrrrclear0szReadOnlyDict.clearNcCstddS)Nz,'mappingproxy' object has no attribute 'pop')r)rrdefaultrrrpop5szReadOnlyDict.popcCstddS)Nz0'mappingproxy' object has no attribute 'popitem')r)rrrrpopitem:szReadOnlyDict.popitemcCstddS)Nz3'mappingproxy' object has no attribute 'setdefault')r)rrrrrr
setdefault?szReadOnlyDict.setdefaultcCsdt|jdS)Nz
mappingproxy())reprdata)rrrr__repr__DszReadOnlyDict.__repr__)__name__
__module____qualname____doc__rrrrrrrr"rrrrrsrcCst}|jj||S)N)rr!r)rresrrrmetadata_proxyHs	r(cCs
t|tS)N)rr)r
rrrr
NsclasscCs
|jS)N)items)rrrrrSscCstjt|S)N)r	MappingProxyTypedict)rrrrr(VscCs1yddl}|SWntk
r,dSYnXdS)z0
    Moved into a function for testability.
    rN)ctypesImportError)r-rrr
import_ctypesZs

r/cOstjdtdddS)z
        We only warn on Python 3 because we are not aware of any concrete
        consequences of not setting the cell on Python 2.
        ziMissing ctypes.  Some features like bare super() or accessing __class__ will not work with slots classes.
stacklevelrN)warningswarnRuntimeWarning)argskwrrr	just_warnfsr6cOsdS)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)r4r5rrrr6rscCsdtrdd}nKt}|dk	rZ|jj}|j|jf|_|j|_nt}|S)z0
    Moved into a function for testability.
    cSs|j|fdS)N)__setstate__)Zcellvaluerrrset_closure_cell~sz/make_set_closure_cell.<locals>.set_closure_cellN)	PYPYr/Z	pythonapiZ
PyCell_SetZ	py_objectZargtypesZc_intZrestyper6)r9r-rrrmake_set_closure_cellys	r;)Z
__future__rrrplatformsysr	r1version_infoZPY2Zpython_implementationr:UserDictrr
ZTYPErrr(r/r6r;r9rrrr<module>s.,
Back to Directory File Manager