o
    b8	                     @   s   d Z G dd dZG dd dZG dd deZddlmZ G d	d
 d
edZG dd de	jdZ
G dd dedZG dd dedZG dd dedZG dd deZdd ZdS )zSTest warnings about access to undefined variables
for various Python 3 constructs. c                   @   s8   e Zd ZdZdefddZdZdefddZdd	 Zd
S )	Undefinedz# test various annotation problems. returnc                 C      dS )z3 used Undefined, which is Undefined in this scope. N selfr   r   m/var/www/secure340b-portal/env/lib/python3.10/site-packages/pylint/test/functional/undefined_variable_py30.pytest       zUndefined.testTc                 C   r   )z' This Undefined exists at local scope. Nr   r   r   r   r   test1   r	   zUndefined.test1c                 C   s   dt fdd}|S )z This should not emit. r   c                   S   r   ) empty    r   r   r   r   r   func   s   zUndefined.test2.<locals>.func)r   )r   r   r   r   r   test2   s   zUndefined.test2N)__name__
__module____qualname____doc__r   r   r
   r   r   r   r   r   r      s    r   c                   @   s&   e Zd ZdZdZdZG dd dZdS )
Undefined1z Other annotation problems. *   c                   @   s,   e Zd ZdZdefddZdefddZdS )zUndefined1.InnerScopez Test inner scope definition. r   c                 C   r   )z* Looking at a higher scope is impossible. Nr   r   r   r   r   test_undefined!   r	   z$Undefined1.InnerScope.test_undefinedc                 C   r   )z Triggers undefined-variable. Nr   r   r   r   r   r
   $   r	   zUndefined1.InnerScope.test1N)r   r   r   r   Undefr   ABCr
   r   r   r   r   
InnerScope   s    r   N)r   r   r   r   r   r   r   r   r   r   r   r      s
    r   c                   @   sL   e Zd ZdZdZdefddZdefddZdefd	d
Z	de
fddZdS )FalsePositive342z Fix some false positives found in
    https://bitbucket.org/logilab/pylint/issue/342/spurious-undefined-variable-for-class
    r   bacc                 C   r   )z  top is defined at this moment. Nr   r   r   r   r   r   	test_good0   r	   zFalsePositive342.test_goodc                 C   r   )z# trop is undefined at this moment. Nr   r   r   r   r   test_bad3   r	   zFalsePositive342.test_badargsc                 G   r   )z$ trop1 is undefined at this moment. Nr   )r   r   r   r   r   	test_bad16   r	   zFalsePositive342.test_bad1c                 K   r   )z$ trop2 is undefined at this moment. Nr   r   r   r   r   	test_bad29   r	   zFalsePositive342.test_bad2N)r   r   r   r   topr   Ztropr   Ztrop1r   Ztrop2r    r   r   r   r   r   (   s    r       )ABCMetac                   @      e Zd ZdZdS )Badz Notice the typo Nr   r   r   r   r   r   r   r   r%   >       r%   )	metaclassc                   @   r$   )	SecondBadz Notice the `ab` module. Nr&   r   r   r   r   r)   A   r'   r)   c                   @   r$   )Goodz3 int is not a proper metaclass, but it is defined. Nr&   r   r   r   r   r*   D   r'   r*   c                   @   r$   )
SecondGoodr   Nr&   r   r   r   r   r+   G   r'   r+   c                   @   r$   )	ThirdGoodr   Nr&   r   r   r   r   r,   J   r'   r,   c                   @   r$   )
FourthGoodz# This should not trigger anything. Nr&   r   r   r   r   r-   M   r'   r-   c                 C   s   | d S )N   r   )argr   r   r   used_before_assignmentR   s    r0   N)r   r   r   objectr   abcr#   ZABCMetr%   abr)   intr*   r+   r,   r-   r0   r   r   r   r   <module>   s    