a
    t‡d`œ*  ã                   @   s  d Z G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZ	G dd„ deƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd „ d eƒZG d!d"„ d"eƒZG d#d$„ d$eƒZG d%d&„ d&eƒZG d'd(„ d(eƒZG d)d*„ d*eƒZG d+d,„ d,eƒZG d-d.„ d.eƒZG d/d0„ d0eƒZG d1d2„ d2eƒZG d3d4„ d4eƒZG d5d6„ d6eƒZG d7d8„ d8eƒZG d9d:„ d:eƒZG d;d<„ d<eƒZG d=d>„ d>eƒZ G d?d@„ d@eƒZ!G dAdB„ dBeƒZ"G dCdD„ dDeƒZ#G dEdF„ dFeƒZ$G dGdH„ dHeƒZ%G dIdJ„ dJeƒZ&G dKdL„ dLeƒZ'G dMdN„ dNeƒZ(G dOdP„ dPeƒZ)G dQdR„ dReƒZ*G dSdT„ dTeƒZ+G dUdV„ dVeƒZ,G dWdX„ dXeƒZ-G dYdZ„ dZeƒZ.G d[d\„ d\eƒZ/G d]d^„ d^eƒZ0G d_d`„ d`eƒZ1G dadb„ dbeƒZ2dcS )dz/
Provide the class Message and its subclasses.
c                   @   s$   e Zd ZdZdZdd„ Zdd„ ZdS )ÚMessageÚ © c                 C   s    || _ |j| _t|ddƒ| _d S )NÚ
col_offseté    )ÚfilenameÚlinenoÚgetattrÚcol)Úselfr   Úlocr   r   ú0lib/python3.9/site-packages/pyflakes/messages.pyÚ__init__
   s    zMessage.__init__c                 C   s"   d| j | j| jd | j| j f S )Nz%s:%s:%s %sé   )r   r   r	   ÚmessageÚmessage_args)r
   r   r   r   Ú__str__   s    
ÿzMessage.__str__N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚUnusedImportz%r imported but unusedc                 C   s   t  | ||¡ |f| _d S ©N©r   r   r   ©r
   r   r   Únamer   r   r   r      s    zUnusedImport.__init__N©r   r   r   r   r   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚRedefinedWhileUnusedz&redefinition of unused %r from line %rc                 C   s   t  | ||¡ ||jf| _d S r   ©r   r   r   r   ©r
   r   r   r   Zorig_locr   r   r   r      s    zRedefinedWhileUnused.__init__Nr   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚRedefinedInListCompz,list comprehension redefines %r from line %rc                 C   s   t  | ||¡ ||jf| _d S r   r   r   r   r   r   r   '   s    zRedefinedInListComp.__init__Nr   r   r   r   r   r   $   s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚImportShadowedByLoopVarz0import %r from line %r shadowed by loop variablec                 C   s   t  | ||¡ ||jf| _d S r   r   r   r   r   r   r   /   s    z ImportShadowedByLoopVar.__init__Nr   r   r   r   r   r   ,   s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚImportStarNotPermittedz/'from %s import *' only allowed at module levelc                 C   s   t  | ||¡ |f| _d S r   r   ©r
   r   r   Úmodnamer   r   r   r   7   s    zImportStarNotPermitted.__init__Nr   r   r   r   r   r    4   s   r    c                   @   s   e Zd ZdZdd„ ZdS )ÚImportStarUsedz9'from %s import *' used; unable to detect undefined namesc                 C   s   t  | ||¡ |f| _d S r   r   r!   r   r   r   r   ?   s    zImportStarUsed.__init__Nr   r   r   r   r   r#   <   s   r#   c                   @   s   e Zd ZdZdd„ ZdS )ÚImportStarUsagez5%r may be undefined, or defined from star imports: %sc                 C   s   t  | ||¡ ||f| _d S r   r   )r
   r   r   r   Ú	from_listr   r   r   r   G   s    zImportStarUsage.__init__Nr   r   r   r   r   r$   D   s   r$   c                   @   s   e Zd ZdZdd„ ZdS )ÚUndefinedNamezundefined name %rc                 C   s   t  | ||¡ |f| _d S r   r   r   r   r   r   r   O   s    zUndefinedName.__init__Nr   r   r   r   r   r&   L   s   r&   c                   @   s   e Zd ZdZddd„ZdS )ÚDoctestSyntaxErrorzsyntax error in doctestNc                 C   s(   t  | ||¡ |r|\| _| _d| _d S ©Nr   )r   r   r   r	   r   )r
   r   r   Zpositionr   r   r   r   W   s    zDoctestSyntaxError.__init__)Nr   r   r   r   r   r'   T   s   r'   c                   @   s   e Zd ZdZdd„ ZdS )ÚUndefinedExportzundefined name %r in __all__c                 C   s   t  | ||¡ |f| _d S r   r   r   r   r   r   r   a   s    zUndefinedExport.__init__Nr   r   r   r   r   r)   ^   s   r)   c                   @   s    e Zd ZdZdZdZdd„ ZdS )ÚUndefinedLocalz2local variable %r {0} referenced before assignmentz%defined in enclosing scope on line %rzdefined as a builtinc                 C   sN   t  | ||¡ |d u r.| j | j¡| _|| _n| j | j¡| _||jf| _d S r   )r   r   r   ÚformatÚbuiltinr   Údefaultr   r   r   r   r   r   l   s    zUndefinedLocal.__init__N)r   r   r   r   r-   r,   r   r   r   r   r   r*   f   s   r*   c                   @   s   e Zd ZdZdd„ ZdS )ÚDuplicateArgumentz,duplicate argument %r in function definitionc                 C   s   t  | ||¡ |f| _d S r   r   r   r   r   r   r   y   s    zDuplicateArgument.__init__Nr   r   r   r   r   r.   v   s   r.   c                   @   s   e Zd ZdZdd„ ZdS )ÚMultiValueRepeatedKeyLiteralz0dictionary key %r repeated with different valuesc                 C   s   t  | ||¡ |f| _d S r   r   ©r
   r   r   Úkeyr   r   r   r      s    z%MultiValueRepeatedKeyLiteral.__init__Nr   r   r   r   r   r/   ~   s   r/   c                   @   s   e Zd ZdZdd„ ZdS )ÚMultiValueRepeatedKeyVariablez9dictionary key variable %s repeated with different valuesc                 C   s   t  | ||¡ |f| _d S r   r   r0   r   r   r   r   ‰   s    z&MultiValueRepeatedKeyVariable.__init__Nr   r   r   r   r   r2   †   s   r2   c                   @   s   e Zd ZdZdd„ ZdS )ÚLateFutureImportz?from __future__ imports must occur at the beginning of the filec                 C   s   t  | ||¡ d| _d S r(   r   ©r
   r   r   Únamesr   r   r   r   ‘   s    zLateFutureImport.__init__Nr   r   r   r   r   r3   Ž   s   r3   c                   @   s   e Zd ZdZdZdd„ ZdS )ÚFutureFeatureNotDefinedz2An undefined __future__ feature name was imported.z future feature %s is not definedc                 C   s   t  | ||¡ |f| _d S r   r   r   r   r   r   r   š   s    z FutureFeatureNotDefined.__init__N©r   r   r   Ú__doc__r   r   r   r   r   r   r6   –   s   r6   c                   @   s   e Zd ZdZdZdd„ ZdS )ÚUnusedVariablez^
    Indicates that a variable has been explicitly assigned to but not actually
    used.
    z/local variable %r is assigned to but never usedc                 C   s   t  | ||¡ |f| _d S r   r   r4   r   r   r   r   ¦   s    zUnusedVariable.__init__Nr7   r   r   r   r   r9   Ÿ   s   r9   c                   @   s   e Zd ZdZdZdS )ÚReturnWithArgsInsideGeneratorzI
    Indicates a return statement with arguments inside a generator.
    z''return' with argument inside generatorN©r   r   r   r8   r   r   r   r   r   r:   «   s   r:   c                   @   s   e Zd ZdZdZdS )ÚReturnOutsideFunctionzD
    Indicates a return statement outside of a function/method.
    z'return' outside functionNr;   r   r   r   r   r<   ²   s   r<   c                   @   s   e Zd ZdZdZdS )ÚYieldOutsideFunctionzQ
    Indicates a yield or yield from statement outside of a function/method.
    z'yield' outside functionNr;   r   r   r   r   r=   ¹   s   r=   c                   @   s   e Zd ZdZdZdS )ÚContinueOutsideLoopzH
    Indicates a continue statement outside of a while or for loop.
    z'continue' not properly in loopNr;   r   r   r   r   r>   Â   s   r>   c                   @   s   e Zd ZdZdZdS )ÚBreakOutsideLoopzE
    Indicates a break statement outside of a while or for loop.
    z'break' outside loopNr;   r   r   r   r   r?   É   s   r?   c                   @   s   e Zd ZdZdZdS )ÚContinueInFinallyzS
    Indicates a continue statement in a finally block in a while or for loop.
    z0'continue' not supported inside 'finally' clauseNr;   r   r   r   r   r@   Ð   s   r@   c                   @   s   e Zd ZdZdZdS )ÚDefaultExceptNotLastzG
    Indicates an except: block as not the last exception handler.
    zdefault 'except:' must be lastNr;   r   r   r   r   rA   ×   s   rA   c                   @   s   e Zd ZdZdZdS )ÚTwoStarredExpressionszK
    Two or more starred expressions in an assignment (a, *b, *c = d).
    z%two starred expressions in assignmentNr;   r   r   r   r   rB   Þ   s   rB   c                   @   s   e Zd ZdZdZdS )Ú%TooManyExpressionsInStarredAssignmentzC
    Too many expressions in an assignment with star-unpacking
    z1too many expressions in star-unpacking assignmentNr;   r   r   r   r   rC   å   s   rC   c                   @   s   e Zd ZdZdZdS )ÚIfTuplezO
    Conditional test is a non-empty tuple literal, which are always True.
    zC'if tuple literal' is always true, perhaps remove accidental comma?Nr;   r   r   r   r   rD   ì   s   rD   c                   @   s   e Zd ZdZdZdS )ÚAssertTuplezM
    Assertion test is a non-empty tuple literal, which are always True.
    z5assertion is always true, perhaps remove parentheses?Nr;   r   r   r   r   rE   ó   s   rE   c                   @   s   e Zd ZdZdd„ ZdS )ÚForwardAnnotationSyntaxErrorz%syntax error in forward annotation %rc                 C   s   t  | ||¡ |f| _d S r   r   ©r
   r   r   Ú
annotationr   r   r   r   ý   s    z%ForwardAnnotationSyntaxError.__init__Nr   r   r   r   r   rF   ú   s   rF   c                   @   s   e Zd ZdZdd„ ZdS )ÚCommentAnnotationSyntaxErrorzsyntax error in type comment %rc                 C   s   t  | ||¡ |f| _d S r   r   rG   r   r   r   r     s    z%CommentAnnotationSyntaxError.__init__Nr   r   r   r   r   rI     s   rI   c                   @   s   e Zd ZdZdS )ÚRaiseNotImplementedz<'raise NotImplemented' should be 'raise NotImplementedError'N©r   r   r   r   r   r   r   r   rJ   
  s   rJ   c                   @   s   e Zd ZdZdS )ÚInvalidPrintSyntaxz(use of >> is invalid with print functionNrK   r   r   r   r   rL     s   rL   c                   @   s   e Zd ZdZdS )Ú	IsLiteralzFuse ==/!= to compare constant literals (str, bytes, int, float, tuple)NrK   r   r   r   r   rM     s   rM   c                   @   s   e Zd ZdZdS )ÚFStringMissingPlaceholdersz f-string is missing placeholdersNrK   r   r   r   r   rN     s   rN   c                   @   s   e Zd ZdZdd„ ZdS )Ú'StringDotFormatExtraPositionalArgumentsz9'...'.format(...) has unused arguments at position(s): %sc                 C   s   t  | ||¡ |f| _d S r   r   )r
   r   r   Zextra_positionsr   r   r   r     s    z0StringDotFormatExtraPositionalArguments.__init__Nr   r   r   r   r   rO     s   rO   c                   @   s   e Zd ZdZdd„ ZdS )Ú"StringDotFormatExtraNamedArgumentsz2'...'.format(...) has unused named argument(s): %sc                 C   s   t  | ||¡ |f| _d S r   r   ©r
   r   r   Zextra_keywordsr   r   r   r   %  s    z+StringDotFormatExtraNamedArguments.__init__Nr   r   r   r   r   rP   "  s   rP   c                   @   s   e Zd ZdZdd„ ZdS )ÚStringDotFormatMissingArgumentz?'...'.format(...) is missing argument(s) for placeholder(s): %sc                 C   s   t  | ||¡ |f| _d S r   r   ©r
   r   r   Zmissing_argumentsr   r   r   r   -  s    z'StringDotFormatMissingArgument.__init__Nr   r   r   r   r   rR   *  s   rR   c                   @   s   e Zd ZdZdS )ÚStringDotFormatMixingAutomaticz6'...'.format(...) mixes automatic and manual numberingNrK   r   r   r   r   rT   2  s   rT   c                   @   s   e Zd ZdZdd„ ZdS )ÚStringDotFormatInvalidFormatz/'...'.format(...) has invalid format string: %sc                 C   s   t  | ||¡ |f| _d S r   r   ©r
   r   r   Úerrorr   r   r   r   9  s    z%StringDotFormatInvalidFormat.__init__Nr   r   r   r   r   rU   6  s   rU   c                   @   s   e Zd ZdZdd„ ZdS )ÚPercentFormatInvalidFormatz*'...' %% ... has invalid format string: %sc                 C   s   t  | ||¡ |f| _d S r   r   rV   r   r   r   r   A  s    z#PercentFormatInvalidFormat.__init__Nr   r   r   r   r   rX   >  s   rX   c                   @   s   e Zd ZdZdS )Ú$PercentFormatMixedPositionalAndNamedz8'...' %% ... has mixed positional and named placeholdersNrK   r   r   r   r   rY   F  s   rY   c                   @   s   e Zd ZdZdd„ ZdS )Ú'PercentFormatUnsupportedFormatCharacterz0'...' %% ... has unsupported format character %rc                 C   s   t  | ||¡ |f| _d S r   r   )r
   r   r   Úcr   r   r   r   M  s    z0PercentFormatUnsupportedFormatCharacter.__init__Nr   r   r   r   r   rZ   J  s   rZ   c                   @   s   e Zd ZdZdd„ ZdS )Ú$PercentFormatPositionalCountMismatchz9'...' %% ... has %d placeholder(s) but %d substitution(s)c                 C   s   t  | ||¡ ||f| _d S r   r   )r
   r   r   Zn_placeholdersZn_substitutionsr   r   r   r   U  s    z-PercentFormatPositionalCountMismatch.__init__Nr   r   r   r   r   r\   R  s   r\   c                   @   s   e Zd ZdZdd„ ZdS )Ú PercentFormatExtraNamedArgumentsz-'...' %% ... has unused named argument(s): %sc                 C   s   t  | ||¡ |f| _d S r   r   rQ   r   r   r   r   ]  s    z)PercentFormatExtraNamedArguments.__init__Nr   r   r   r   r   r]   Z  s   r]   c                   @   s   e Zd ZdZdd„ ZdS )ÚPercentFormatMissingArgumentz:'...' %% ... is missing argument(s) for placeholder(s): %sc                 C   s   t  | ||¡ |f| _d S r   r   rS   r   r   r   r   e  s    z%PercentFormatMissingArgument.__init__Nr   r   r   r   r   r^   b  s   r^   c                   @   s   e Zd ZdZdS )ÚPercentFormatExpectedMappingz.'...' %% ... expected mapping but got sequenceNrK   r   r   r   r   r_   j  s   r_   c                   @   s   e Zd ZdZdS )ÚPercentFormatExpectedSequencez.'...' %% ... expected sequence but got mappingNrK   r   r   r   r   r`   n  s   r`   c                   @   s   e Zd ZdZdS )Ú!PercentFormatStarRequiresSequencez,'...' %% ... `*` specifier requires sequenceNrK   r   r   r   r   ra   r  s   ra   N)3r8   Úobjectr   r   r   r   r   r    r#   r$   r&   r'   r)   r*   r.   r/   r2   r3   r6   r9   r:   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rI   rJ   rL   rM   rN   rO   rP   rR   rT   rU   rX   rY   rZ   r\   r]   r^   r_   r`   ra   r   r   r   r   Ú<module>   sb   
		