관리-도구
편집 파일: recommendation_checker.cpython-311.pyc
� �܋f�F � �t � d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlm Z m Z G d� dej � � ZdS ) � )�annotationsN)�nodes)�checkers)�utils)�HIGH� INFERENCEc �T � e Zd ZdZddddddd�Zd)d�Zed*d�� � Z ej dd� � d+d�� � Z d+d�Zd+d�Z ej ddd� � d,d�� � Z d,d�Zd,d�Z ej dd� � d-d �� � Zd-d!�Zd.d#�Z ej d$� � d/d&�� � Zd/d'�Zd(S )0�RecommendationChecker�refactoring)z@Consider using enumerate instead of iterating with range and len�consider-using-enumeratez~Emitted when code that iterates with range and len is encountered. Such code can be simplified by using the enumerate builtin.)zEConsider iterating the dictionary directly instead of calling .keys()�consider-iterating-dictionarya Emitted when the keys of a dictionary are iterated through the ``.keys()`` method or when ``.keys()`` is used for a membership check. It is enough to iterate through the dictionary itself, ``for key in dictionary``. For membership checks, ``if key in dictionary`` is faster.)z Consider iterating with .items()�consider-using-dict-itemsz�Emitted when iterating over the keys of a dictionary and accessing the value by index lookup. Both the key and value can be accessed by iterating using the .items() method of the dictionary instead.)zUse %s instead�use-maxsplit-argz�Emitted when accessing only the first or last element of str.split(). The first and last element can be accessed by using str.split(sep, maxsplit=1)[0] or str.rsplit(sep, maxsplit=1)[-1] instead.)z.Use a sequence type when iterating over values�use-sequence-for-iterationzvWhen iterating over values, sequence types (e.g., ``lists``, ``tuples``, ``ranges``) are more efficient than ``sets``.)z5Formatting a regular string which could be a f-string�consider-using-f-stringz�Used when we detect a string that is being formatted with format() or % which could potentially be a f-string. The use of f-strings is preferred. Requires Python 3.6 and ``py-version >= 3.6``.)�C0200�C0201�C0206�C0207�C0208�C0209�return�Nonec �>