Your IP : 216.73.216.213


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

B

��\��@sPdZddlZddlmZed�Zed�Zefdd�Zdd	�Ze�ej	ee�dS)
zy
Astroid hook for the attrs library

Without this hook pylint reports unsupported-assignment-operation
for attrs classes
�N)�MANAGER)zattr.ibZattribzattr.attrib)zattr.s�attrsz
attr.attrszattr.attributescCsB|js
dSx2|jjD]&}t|tj�r*|j}|��|krdSqWdS)zBReturn True if a decorated node has
    an attr decorator applied.FT)Z
decoratorsZnodes�
isinstance�astroid�Call�func�	as_string)�nodeZdecorator_namesZdecorator_attribute�r
�J/opt/alt/python37/lib/python3.7/site-packages/astroid/brain/brain_attrs.py�is_decorated_with_attrssrcCs�tj|d�g|jd<xr|jD]h}t|tj�s.qt|jtj�r|jj�	�t
krRqnqx0|jD]&}tj|j|j
|d�}|g|j|j<qZWqWdS)zhGiven that the ClassNode has an attr decorator,
    rewrite class attributes as instance attributes
    )�parentZ__attrs_attrs__)�lineno�
col_offsetr
N)r�Unknown�locals�bodyrZAssign�valuerrr�ATTRIB_NAMES�targetsrr�name)r	Zcdefbodynode�targetZrhs_noder
r
r�attr_attributes_transformsr)
�__doc__rr�	frozensetrZATTRS_NAMESrrZregister_transformZClassDefr
r
r
r�<module>s