Your IP : 216.73.217.32


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

B

A!p\+�@srdZddlZddlZddlmZddlmZddlmZm	Z	m
Z
dddd	d
difd�ZGd
d�de�Zdd�Z
dS)z+check for new / old style related problems
�N)�IAstroidChecker)�BaseChecker)�check_messages�node_frame_class�has_known_bases)z&Bad first argument %r given to super()zbad-super-callzbUsed when another argument than the current class is given as first argument of the super builtin.zMissing argument to super()zmissing-super-argumentz7Used when the super builtin didn't receive an argument.Z
maxversion)�r)ZE1003ZE1004c@s<eZdZdZefZdZeZdZ	dZ
edd�dd��ZeZ
d	S)
�NewStyleConflictCheckerz�checks for usage of new style capabilities on old style classes and
    other new/old styles conflicts problems
    * use of property, __slots__, super
    * "super" usage
    �newstyle����zbad-super-callzmissing-super-argumentc		Cs�|��sdS|j��}�x�|�tj�D�]�}t|�t|�kr>q&|j}t|tj	�sRq&|j
}t|tj�r&t|jtj�r&|jjdks�q&|j
s�t|�r�q&q&|js�tjddkr�q&n|jd|d�q&|jd}t|tj�r�t|jtj�r�|jjdkr�|jd|d	d
�q&t|j�dk�r^t|jdtj��r^|jdjd
k�r^t|tj	��r^|jdk�r^|jd|dd
�q&y |j�ozt|jd��d�}Wntjk
�r�w&YnX||k	r&d}|�r�|j}n&|j�r�t|jdd��r�|jdj}|r&|jd||fd
�q&WdS)zcheck use of superN�superrrzmissing-super-argument)�node�typezbad-super-call)r)r
�args���self�	__class__)zself.__class__�name)Z	is_method�parent�frameZnodes_of_class�astroidZCallr�func�
isinstance�	Attribute�expr�Namerr	rr�sys�version_infoZadd_message�len�attrname�nextZinferZInferenceError�hasattr)	rr
�klassZstmtr�callZarg0Zsupclsrrr�I/opt/alt/python37/lib/python3.7/site-packages/pylint/checkers/newstyle.py�visit_functiondef9s^

 z)NewStyleConflictChecker.visit_functiondefN)�__name__�
__module__�__qualname__�__doc__rZ__implements__r�MSGSZmsgs�priority�optionsrr&Zvisit_asyncfunctiondefrrrr%r(sPrcCs|�t|��dS)z.required method to auto register this checker N)Zregister_checkerr)Zlinterrrr%�register�sr.)r*rrZpylint.interfacesrZpylint.checkersrZpylint.checkers.utilsrrrr+rr.rrrr%�<module>sd