o
    2g+                     @  s2  U d Z ddlmZ ddlmZ ddlmZ ddlmZ i Z	de
d< eeZde
d	< ed
dG dd dZedddZde
d< edddZde
d< edddZde
d< edddZde
d< edddZde
d< ed d!dZde
d"< ed#d$dZde
d%< ed&d'dZde
d(< ed)d*dZde
d+< ed,d-dZde
d.< ed/d0dZde
d1< ed2d3ded4Zde
d5< ed6d7dZde
d8< ed9d:dZde
d;< ed<d=dZde
d>< ed?d@dZde
dA< edBdCdZde
dD< edEdFdZde
dG< edHdIdZ de
dJ< edKdLdZ!de
dM< edNdOde!d4Z"de
dP< edQdRdZ#de
dS< edTdUdZ$de
dV< edWdXde$d4Z%de
dY< edZd[de$d4Z&de
d\< ed]d^dZ'de
d_< ed`dadZ(de
db< edcdddZ)de
de< edfdgdZ*de
dh< edidjdZ+de
dk< edldmdZ,de
dn< edodpdZ-de
dq< edrdsdZ.de
dt< edudvdZ/de
dw< edxdydZ0de
dz< ed{d|dZ1de
d}< ed~ddZ2de
d< edddZ3de
d< edddZ4de
d< edddZ5de
d< edddZ6de
d< edddZ7de
d< edddZ8de
d< edddZ9de
d< edddZ:de
d< edddZ;de
d< edddZ<de
d< edddZ=edddZ>edddddZ?de
d< edddddZ@de
d< edddddZAde
d< edddZBde
d< edddddZCde
d< edddZDde
d< edddZEde
d< edddddZFde
d< edddddZGde
d< edddddZHedddZIde
d< edddddZJde
d< edddddZKde
d< edddddZLde
d< edddddZMde
d< edddZNde
d< edddZOde
d< e	eOjP= edddZQde
d< edddeQd4ZRde
d< edddeQd4ZSde
d< edddeQd4ZTedddZUde
d< e	V ZWdS )zeClassification of possible errors mypy can detect.

These can be used for filtering specific errors.
    )annotations)defaultdict)Final)
mypyc_attrzdict[str, ErrorCode]error_codeszdict[str, set[str]]sub_code_mapT)allow_interpreted_subclassesc                   @  s:   e Zd Z		ddddZdddZdddZdddZdS )	ErrorCodeTNcodestrdescriptioncategorydefault_enabledboolsub_code_ofErrorCode | NonereturnNonec                 C  sT   || _ || _|| _|| _|| _|d ur$|jd u sJ dt|j  | | t|< d S )Nz&Nested subcategories are not supported)r
   r   r   r   r   r   addr   )selfr
   r   r   r   r    r   G/home/garg/my-data/venv/lib/python3.10/site-packages/mypy/errorcodes.py__init__   s   zErrorCode.__init__c                 C  s   d| j  dS )Nz<ErrorCode >)r
   r   r   r   r   __str__%   s   zErrorCode.__str__otherobjectc                 C  s   t |tsdS | j|jkS )NF)
isinstancer	   r
   )r   r   r   r   r   __eq__(   s   
zErrorCode.__eq__intc                 C  s   t | jfS )N)hashr
   r   r   r   r   __hash__-   s   zErrorCode.__hash__)TN)r
   r   r   r   r   r   r   r   r   r   r   r   )r   r   )r   r   r   r   )r   r    )__name__
__module____qualname__r   r   r   r"   r   r   r   r   r	      s    

r	   zattr-definedzCheck that attribute existsGeneralr   ATTR_DEFINEDzname-definedzCheck that name is definedNAME_DEFINEDzcall-argz3Check number, names and kinds of arguments in callszFinal[ErrorCode]CALL_ARGzarg-typezCheck argument types in callsARG_TYPEzcall-overloadz0Check that an overload variant matches argumentsCALL_OVERLOADz
valid-typez%Check that type (annotation) is valid
VALID_TYPEzvar-annotatedz5Require variable annotation if type can't be inferredVAR_ANNOTATEDoverridez8Check that method override is compatible with base classOVERRIDEr   z*Check that function always returns a valueRETURNzreturn-valuez4Check that return value is compatible with signatureRETURN_VALUE
assignmentz3Check that assigned value is compatible with target
ASSIGNMENTzmethod-assignz,Check that assignment target is not a method)r   METHOD_ASSIGNztype-argz-Check that generic type arguments are presentTYPE_ARGztype-varz)Check that type variable values are validTYPE_VARz
union-attrz3Check that attribute exists in each item of a union
UNION_ATTRindexzCheck indexing operationsINDEXoperatorz)Check that operator is valid for operandsOPERATORz	list-itemz1Check list items in a list expression [item, ...]	LIST_ITEMz	dict-itemz7Check dict items in a dict expression {key: value, ...}	DICT_ITEMztypeddict-itemz'Check items when constructing TypedDictTYPEDDICT_ITEMztypeddict-unknown-keyz.Check unknown keys when constructing TypedDictTYPEDDICT_UNKNOWN_KEYzhas-typez.Check that type of reference can be determinedHAS_TYPEimportz6Require that imported module can be found or has stubsIMPORTzimport-not-foundz)Require that imported module can be foundIMPORT_NOT_FOUNDzimport-untypedz&Require that imported module has stubsIMPORT_UNTYPEDzno-redefz$Check that each name is defined onceNO_REDEFzfunc-returns-valuez;Check that called function returns a value in value contextFUNC_RETURNS_VALUEabstractz9Prevent instantiation of classes with abstract attributesABSTRACTztype-abstractz9Require only concrete classes where Type[...] is expectedTYPE_ABSTRACTzvalid-newtypez)Check that argument 2 to NewType is validVALID_NEWTYPEz
str-formatz7Check that string formatting/interpolation is type-safeSTRING_FORMATTINGzstr-bytes-safez?Warn about implicit coercions related to bytes and string typesSTR_BYTES_PY3zexit-returnz1Warn about too general return type for '__exit__'EXIT_RETURNzliteral-requiredzCheck that value is a literalLITERAL_REQzunused-coroutinez#Ensure that all coroutines are usedUNUSED_COROUTINEz
empty-bodyzHA dedicated error code to opt out return errors for empty/trivial bodies
EMPTY_BODYz
safe-superz>Warn about calls to abstract methods with empty/trivial bodies
SAFE_SUPERztop-level-awaitz&Warn about top level await expressionsTOP_LEVEL_AWAITzawait-not-asyncz2Warn about "await" outside coroutine ("async def")AWAIT_NOT_ASYNCzno-untyped-defz+Check that every function has an annotationNO_UNTYPED_DEFzno-untyped-callzLDisallow calling functions without type annotations from annotated functionsNO_UNTYPED_CALLzredundant-castz*Check that cast changes type of expressionREDUNDANT_CASTzassert-typez&Check that assert_type() call succeedsASSERT_TYPEzcomparison-overlapz<Check that types in comparisons and 'in' expressions overlapCOMPARISON_OVERLAPzno-any-unimportedz*Reject "Any" types from unfollowed importsNO_ANY_UNIMPORTEDzno-any-returnzBReject returning value with "Any" type if return type is not "Any"NO_ANY_RETURNunreachablez0Warn about unreachable statements or expressionsUNREACHABLEzannotation-uncheckedz4Notify about type annotations in unchecked functionsztypeddict-readonly-mutatedz#TypedDict's ReadOnly key is mutatedzpossibly-undefinedzBWarn about variables that are defined only in some execution pathsF)r   POSSIBLY_UNDEFINEDzredundant-exprz Warn about redundant expressionsREDUNDANT_EXPRztruthy-boolzMWarn about expressions that could always evaluate to true in boolean contextsTRUTHY_BOOLztruthy-functionzDWarn about function that always evaluate to true in boolean contextsTRUTHY_FUNCTIONztruthy-iterablezVWarn about Iterable expressions that could always evaluate to true in boolean contextsTRUTHY_ITERABLEz
name-matchz0Check that type definition has consistent naming
NAME_MATCHzno-overload-implzICheck that overloaded functions outside stub files have an implementationNO_OVERLOAD_IMPLzignore-without-codezBWarn about '# type: ignore' comments which do not have error codesIGNORE_WITHOUT_CODEzunused-awaitablez)Ensure that all awaitable values are usedUNUSED_AWAITABLEzredundant-selfzCWarn about redundant Self type annotations on method first argumentzused-before-defz:Warn about variables that are used before they are definedUSED_BEFORE_DEFzunused-ignorez%Ensure that all type ignores are usedUNUSED_IGNOREzexplicit-overridezGRequire @override decorator if method is overriding a base class methodEXPLICIT_OVERRIDE_REQUIREDzunimported-revealzHRequire explicit import from typing or typing_extensions for reveal_typeUNIMPORTED_REVEALzmutable-overridez1Reject covariant overrides for mutable attributesMUTABLE_OVERRIDEsyntaxzReport syntax errorsSYNTAXfilez.Internal marker for a whole file being ignoredFILEmisczMiscellaneous other checksMISCzoverload-cannot-matchz3Warn if an @overload signature can never be matchedOVERLOAD_CANNOT_MATCHzoverload-overlapz:Warn if multiple @overload variants overlap in unsafe waysOVERLOAD_OVERLAPzprop-decoratorz0Decorators on top of @property are not supportedznarrowed-type-not-subtypezOWarn if a TypeIs function's narrowed type is not a subtype of the original typeNARROWED_TYPE_NOT_SUBTYPEN)X__doc__
__future__r   collectionsr   typingr   mypy_extensionsr   r   __annotations__setr   r	   r'   r(   r)   r*   r+   r,   r-   r/   r0   r1   r3   r4   r5   r6   r7   r9   r;   r<   r=   r>   r?   r@   rB   rC   rD   rE   rF   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r\   ANNOTATION_UNCHECKEDTYPEDDICT_READONLY_MUTATEDr]   r^   r_   r`   ra   rb   rc   rd   re   REDUNDANT_SELF_TYPErf   rg   rh   ri   rj   rl   rn   r
   rp   rq   rr   PROPERTY_DECORATORrs   copymypy_error_codesr   r   r   r   <module>   s   