+
    BiZ                        R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt Rt	Rt
R t ! R R]P                  4      t ! R	 R
]P                  4      t ! R R]P                  4      t]R8X  d   ]P"                  ! 4        R# R# )z&
Test the API of the symtable module.
N)support)	os_helpera  
import sys

glob = 42
some_var = 12
some_non_assigned_global_var: int
some_assigned_global_var = 11

class Mine:
    instance_var = 24
    def a_method(p1, p2):
        pass

def spam(a, b, *var, **kw):
    global bar
    global some_assigned_global_var
    some_assigned_global_var = 12
    bar = 47
    some_var = 10
    x = 23
    glob
    def internal():
        return x
    def other_internal():
        nonlocal some_var
        some_var = 3
        return some_var
    return internal

def foo():
    pass

def namespace_test(): pass
def namespace_test(): pass

type Alias = int
type GenericAlias[T] = list[T]

def generic_spam[T](a):
    pass

class GenericMine[T: int, U: (int, str) = int]:
    pass
aS  
# The following symbols are defined in ComplexClass
# without being introduced by a 'global' statement.
glob_unassigned_meth: Any
glob_unassigned_meth_pep_695: Any

glob_unassigned_async_meth: Any
glob_unassigned_async_meth_pep_695: Any

def glob_assigned_meth(): pass
def glob_assigned_meth_pep_695[T](): pass

async def glob_assigned_async_meth(): pass
async def glob_assigned_async_meth_pep_695[T](): pass

# The following symbols are defined in ComplexClass after
# being introduced by a 'global' statement (and therefore
# are not considered as local symbols of ComplexClass).
glob_unassigned_meth_ignore: Any
glob_unassigned_meth_pep_695_ignore: Any

glob_unassigned_async_meth_ignore: Any
glob_unassigned_async_meth_pep_695_ignore: Any

def glob_assigned_meth_ignore(): pass
def glob_assigned_meth_pep_695_ignore[T](): pass

async def glob_assigned_async_meth_ignore(): pass
async def glob_assigned_async_meth_pep_695_ignore[T](): pass

class ComplexClass:
    a_var = 1234
    a_genexpr = (x for x in [])
    a_lambda = lambda x: x

    type a_type_alias = int
    type a_type_alias_pep_695[T] = list[T]

    class a_class: pass
    class a_class_pep_695[T]: pass

    def a_method(self): pass
    def a_method_pep_695[T](self): pass

    async def an_async_method(self): pass
    async def an_async_method_pep_695[T](self): pass

    @classmethod
    def a_classmethod(cls): pass
    @classmethod
    def a_classmethod_pep_695[T](self): pass

    @classmethod
    async def an_async_classmethod(cls): pass
    @classmethod
    async def an_async_classmethod_pep_695[T](self): pass

    @staticmethod
    def a_staticmethod(): pass
    @staticmethod
    def a_staticmethod_pep_695[T](self): pass

    @staticmethod
    async def an_async_staticmethod(): pass
    @staticmethod
    async def an_async_staticmethod_pep_695[T](self): pass

    # These ones will be considered as methods because of the 'def' although
    # they are *not* valid methods at runtime since they are not decorated
    # with @staticmethod.
    def a_fakemethod(): pass
    def a_fakemethod_pep_695[T](): pass

    async def an_async_fakemethod(): pass
    async def an_async_fakemethod_pep_695[T](): pass

    # Check that those are still considered as methods
    # since they are not using the 'global' keyword.
    def glob_unassigned_meth(): pass
    def glob_unassigned_meth_pep_695[T](): pass

    async def glob_unassigned_async_meth(): pass
    async def glob_unassigned_async_meth_pep_695[T](): pass

    def glob_assigned_meth(): pass
    def glob_assigned_meth_pep_695[T](): pass

    async def glob_assigned_async_meth(): pass
    async def glob_assigned_async_meth_pep_695[T](): pass

    # The following are not picked as local symbols because they are not
    # visible by the class at runtime (this is equivalent to having the
    # definitions outside of the class).
    global glob_unassigned_meth_ignore
    def glob_unassigned_meth_ignore(): pass
    global glob_unassigned_meth_pep_695_ignore
    def glob_unassigned_meth_pep_695_ignore[T](): pass

    global glob_unassigned_async_meth_ignore
    async def glob_unassigned_async_meth_ignore(): pass
    global glob_unassigned_async_meth_pep_695_ignore
    async def glob_unassigned_async_meth_pep_695_ignore[T](): pass

    global glob_assigned_meth_ignore
    def glob_assigned_meth_ignore(): pass
    global glob_assigned_meth_pep_695_ignore
    def glob_assigned_meth_pep_695_ignore[T](): pass

    global glob_assigned_async_meth_ignore
    async def glob_assigned_async_meth_ignore(): pass
    global glob_assigned_async_meth_pep_695_ignore
    async def glob_assigned_async_meth_pep_695_ignore[T](): pass
c                 f    V P                  4        F  pVP                  4       V8X  g   K  Vu # 	  R # N)get_childrenget_name)blocknamechs   && )/usr/lib/python3.14/test/test_symtable.py
find_blockr      s(      ";;=D I #    c                     a  ] tR t^t o ]P                  ! ]RR4      t]! ]R4      t]! ]R4      t	]! ]R4      t
]! ]
R4      t]! ]
R4      t]! ]R4      t]! ]R	4      t]! ]R
4      t]! ]R
4      t]! ]R4      t]! ]R4      t]! ]R4      t]! ]R4      t]! ]R4      t]! ]R4      tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R t$R t%R t&R t'R  t(R! t)R" t*R# t+R$ t,R% t-R& t.R' t/R( t0R) t1R* t2R+t3V t4R,# )-SymtableTest?execMinea_methodspaminternalother_internalfooAliasGenericAliasgeneric_spamGenericMineTUc                   V P                  V P                  P                  4       R 4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P
                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                  P                  4       R4       V P                  V P                   P                  4       R4       R# )moduleclassfunctionz
type aliasztype parametersztype variableN)assertEqualtopget_typer   r   r   r   r   r   r   GenericAlias_innerr   generic_spam_innerr   GenericMine_innerr   r   selfs   &r   	test_typeSymtableTest.test_type   s   **,h7++-w7//1:>++-z://1:>**,j9,,.=**3357HI0099;\J**3357HI0099;ZH))2246GH//88:GD*O<*O<r   c                N   V P                  V P                  P                  4       ^ 4       V P                  V P                  P                  4       ^ 4       V P                  V P                  P                  4       ^ 4       V P                  V P
                  P                  4       ^ 4       V P                  V P                  P                  4       ^ 4       V P                  V P                  P                  4       ^ 4       V P                  V P                  P                  4       ^ 4       V P                  V P                  P                  4       ^ 4       V P                  V P                  P                  4       ^ 4       V P                  V P                  P                  4       ^ 4       R#     N)assertGreaterr#   get_idr   r   r   r   r   r   r   r   r   r(   s   &r   test_idSymtableTest.test_id   s&   488??,a0499++-q14==//115499++-q14==//115488??,a04::,,.24,,335q94,,335q94++224a8r   c                    V P                  V P                  P                  4       4       V P                  V P                  P                  4       4       R # r   )assertFalser#   is_optimized
assertTruer   r(   s   &r   test_optimizedSymtableTest.test_optimized   s6    ..01		..01r   c                N   V P                  V P                  P                  4       4       V P                  V P                  P                  4       4       V P                  V P                  P                  4       4       V P                  V P                  P                  4       4       R # r   )r4   r#   	is_nestedr   r   r6   r   r(   s   &r   test_nestedSymtableTest.test_nested   sl    ++-.,,./,,.///12r   c                    V P                  V P                  P                  4       4       V P                  V P                  P                  4       4       V P	                  V P
                  P                  4       4       R # r   )r6   r#   has_childrenr   r4   r   r(   s   &r   test_childrenSymtableTest.test_children   sO    --/0		..01..01r   c                    V P                  V P                  P                  4       ^ 4       V P                  V P                  P                  4       ^4       R# r-   )r"   r#   
get_linenor   r(   s   &r   test_linenoSymtableTest.test_lineno   s<    ,,.2--/4r   c                x   V P                   pV P                  \        VP                  4       4      . RO4       . ROpV P                  \        VP	                  4       4      V4       V P                  \        VP                  4       4      . RO4       V P                  V P                  P                  4       R4       R# )aN)rF   bkwvar)rF   rG   r   rH   r   some_varrI   x)barglobsome_assigned_global_var)rK   )r   r"   sortedget_parameters
get_localsget_globalsr   	get_frees)r)   funcexpecteds   &  r   test_function_infoSymtableTest.test_function_info   s    yy 3 3 568OPY 12H= 0 0 235`a002F;r   c                   V P                  V P                  P                  R 4      P                  4       4       V P	                  V P                  P                  R 4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P	                  V P                  P                  R4      P                  4       4       V P	                  V P                  P                  R4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       R# )rM   rL   rK   instance_varsome_non_assigned_global_varrN   N)	r6   r   lookup	is_globalr4   is_declared_globalr   r   r#   r(   s   &r   test_globalsSymtableTest.test_globals  sJ   		((0::<=))&1DDFG		((/99;<		((/BBDE--c2<<>?)).9CCEF		((/99;<(FGQQST(BCMMOPr   c                >   V P                  V P                  P                  R 4      P                  4       4       V P	                  V P
                  P                  R 4      P                  4       4       RpV P                  V P
                  P                  4       V4       R# )rJ   N)rJ   )r4   r   r[   is_nonlocalr6   r   r"   get_nonlocalsr)   rU   s   & r   test_nonlocalSymtableTest.test_nonlocal  sr    ))*5AACD++22:>JJLM ,,::<hGr   c                   V P                  V P                  P                  R 4      P                  4       4       V P	                  V P                  P                  R4      P                  4       4       V P                  V P
                  P                  R4      P                  4       4       V P                  V P
                  P                  R4      P                  4       4       R# )rK   rL   rZ   rN   N)r6   r   r[   is_localr4   r#   r(   s   &r   
test_localSymtableTest.test_local  s    		((-6689))%099;<(FGPPRS(BCLLNOr   c                v    V P                  V P                  P                  R 4      P                  4       4       R# )rK   N)r6   r   r[   is_freer(   s   &r   	test_freeSymtableTest.test_free  s&    ,,S199;<r   c                V   V P                  V P                  P                  R 4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P                  P                  R 4      P                  4       4       R# )rK   r   N)r6   r   r[   is_referencedr   r4   r(   s   &r   test_referencedSymtableTest.test_referenced  sp    ,,S1??AB		((4BBDE))#.<<>?r   c                    R F;  pV P                  V P                  P                  V4      P                  4       4       K=  	  V P	                  V P                  P                  R4      P                  4       4       R# )rF   rK   N)rF   rI   rH   )r6   r   r[   is_parameterr4   )r)   syms   & r   test_parametersSymtableTest.test_parameters#  sV    %COODII,,S1>>@A &))#.;;=>r   c                   V P                  \        V P                  P                  4       4      \        V P                  P	                  4       4      4       V P                  \        V P                  P                  R 4       R# )not_hereN)r"   lenr#   get_identifiersget_symbolsassertRaisesKeyErrorr[   r(   s   &r   test_symbol_lookupSymtableTest.test_symbol_lookup(  sU    TXX5578TXX1134	6 	(DHHOOZ@r   c                   V P                  V P                  P                  R 4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P
                  P                  R4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P
                  P                  R4      P                  4       4       V P                  V P                  P                  R4      P                  4       V P
                  J 4       V P                  P                  R4      pV P                  \        VP                  4       4      ^4       V P                  \        VP                  4       V P                  P                  R4      pV P                  \        VP                  4       4      ^ 4       V P                  \        VP                  4       R# )r   r   r   r   namespace_testrK   rM   N)r6   r#   r[   is_namespacer   r   r4   get_namespacer"   ry   get_namespacesr|   
ValueError)r)   ns_test	ns_test_2s   &  r   test_namespacesSymtableTest.test_namespaces.  s   /<<>?		((4AACD/<<>?		((4AACD(89FFHI))#.;;=>/==?499LM((//"23W3356:*g&;&;<HHOOF+	Y5578!<*i&=&=>r   c                6   V P                  V P                  P                  R 4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P                  P                  R4      P                  4       4       V P                  V P
                  P                  R4      P                  4       4       V P                  V P                  P                  R 4      P                  4       4       R# )rK   rL   r   r   N)r6   r   r[   is_assignedr#   r   r4   r   r(   s   &r   test_assignedSymtableTest.test_assigned?  s    		((-99;<		((/;;=>/;;=>		((4@@BC--c2>>@Ar   c                   \         P                   ! R RR4      pVP                  4       ^,          pV P                  VP                  4       R4       V P	                  VP                  R4      P                  4       4       V P	                  VP                  R4      P                  4       4       V P                  VP                  R4      P                  4       4       \         P                   ! RRR4      pVP                  4       ^,          pV P                  VP                  4       R4       V P	                  VP                  R4      P                  4       4       V P                  VP                  R4      P                  4       4       \         P                   ! RRR4      pV P	                  VP                  R4      P                  4       4       \         P                   ! RRR4      pR# )	zdef f():
    x: int
testr   r!   rK   zdef f():
    x = 1
zglobal x
x: intz=def g():
    x = 2
    def f():
        nonlocal x
    x: intN)
symtabler   r"   r$   r6   r[   rg   is_annotatedr4   r\   )r)   st1st2st3st4st5st6s   &      r   test_annotatedSymtableTest.test_annotatedF  se    8&&I #4

30023

34467C2245 7H #4

30023C5578  2FFC

31134  !-
 !'0r   c                v    V P                  V P                  P                  R 4      P                  4       4       R# )sysN)r6   r#   r[   is_importedr(   s   &r   test_importedSymtableTest.test_importeda  s$    .::<=r   c                t   V P                  V P                  P                  4       R 4       V P                  V P                  P                  4       R4       V P                  V P                  P	                  R4      P                  4       R4       V P                  V P
                  P                  4       R4       R# )r#   r   rK   r   N)r"   r#   r   r   r[   r   r(   s   &r   	test_nameSymtableTest.test_named  s    **,e4++-v6))#.7793?++-v6r   c                2  a a \         P                  ! R 4      oS P                  \        S4      ;_uu_ 4        S P	                  S P
                  P                  4       R4       RRR4       \        P                  ! \        RR4      p\        VR4      pS P                  \        S4      ;_uu_ 4        S P	                  VP                  4       R4       RRR4       VV 3R lpRpV F  pS P                  VR7      ;_uu_ 4        V! VR4       RRR4       S P                  VRR7      ;_uu_ 4        V! R	P                  VR
34      R4       V! R	P                  R
V34      R4       RRR4       K  	  R F  pRV R2RV R2RV R2RV R23 F  pS P                  VR7      ;_uu_ 4        V! VR4       RRR4       V FX  pS P                  WWR7      ;_uu_ 4        V! R	P                  WW34      R4       V! R	P                  Wu34      R4       RRR4       KZ  	  K  	  K  	  R#   + '       g   i     EL; i  + '       g   i     ELm; i  + '       g   i     ELG; i  + '       g   i     EK  ; i  + '       g   i     L; i  + '       g   i     K  ; i)zNsymtable.Class.get_methods() is deprecated and will be removed in Python 3.16.Nr   r   ComplexClassc                 :  < \         P                  ! V R4      p\        P                  ! RV 2RR4      p\        VR4      pSP	                  \
        S4      ;_uu_ 4        SP                  VP                  4       V4       RRR4       R#   + '       g   i     R# ; i) z	class A:
r   r   ANz    )textwrapindentr   r   assertWarnsRegexDeprecationWarningr"   get_methods)bodyexpected_methodsindentedr#   thisdeprecation_messr)   s   &&   r   
check_body7SymtableTest.test_class_get_methods.<locals>.check_body  sy    tW5H##j
$;S&ICc3'D&&'9;KLL  !1!1!35EF MLLLs   !B		B	)genT)r   isvar
zgenexpr = 1zdef genexprz:passzasync def genexprzdef genexpr[T]zasync def genexpr[T])rT   )r   rT   )r   )r   a_method_pep_695an_async_methodan_async_method_pep_695a_classmethoda_classmethod_pep_695an_async_classmethodan_async_classmethod_pep_695a_staticmethoda_staticmethod_pep_695an_async_staticmethodan_async_staticmethod_pep_695a_fakemethoda_fakemethod_pep_695an_async_fakemethodan_async_fakemethod_pep_695glob_unassigned_methglob_unassigned_meth_pep_695glob_unassigned_async_meth"glob_unassigned_async_meth_pep_695glob_assigned_methglob_assigned_meth_pep_695glob_assigned_async_meth glob_assigned_async_meth_pep_695)zx = (x for x in [])zx = (x async for x in [])z3type x[genexpr = (x for x in [])] = (x for x in [])z?type x[genexpr = (x async for x in [])] = (x async for x in [])zgenexpr = (x for x in [])zgenexpr = (x async for x in [])z9type genexpr[genexpr = (x for x in [])] = (x for x in [])zEtype genexpr[genexpr = (x async for x in [])] = (x async for x in []) )z()z(x)z(x, y)z(z: T))genexpr)reescaper   r   r"   r   r   r   TEST_COMPLEX_CLASS_CODEr   subTestjoin)	r)   r#   r   r   GENEXPRSr   	paramlistrT   r   s	   f       @r   test_class_get_methods#SymtableTest.test_class_get_methodsj  s7   II < = 	
 ""#57GHHTYY224mD I  7fE#~.""#57GHHT--/ 2  I.	G	
 C#&&3# ' #T22499c=%9:B?499mS%9:B? 32  ;Ii[.#I;e4 51&yk7	 \\t\,,t\2 - $C#99"499c[#9<H"499d[#9<H :9 $ ;u IHH IHHX '&& 322 -,
 :99sG   +H!0!H5
I	.5I'
I2	3J!H2	5I		II/2JJc                  a  V 3R  lpV! R^4       V! R^4       \         P                   ! RRR4       S P                  \        4      ;_uu_ 4        \         P                   ! R\        R4      R4       RRR4       S P                  \        4      ;_uu_ 4        \         P                   ! R\	        R4      R4       RRR4       S P                  \        4      ;_uu_ 4        \         P                   ! R\        R4      R4       RRR4       R#   + '       g   i     L; i  + '       g   i     Ll; i  + '       g   i     R# ; i)c                 >  <  \         P                   ! V R R4       SP                  RV : 24       R#   \         d`   pSP                  TP                  R 4       SP                  TP
                  ^4       SP                  TP                  T4        Rp?R# Rp?ii ; i)r   r   zno SyntaxError for N)r   failSyntaxErrorr"   filenamelinenooffset)
brokencoder   er)   s   && r   checkfilename9SymtableTest.test_filename_correct.<locals>.checkfilename  s}    C!!*ff= 		ZAB  3  V4  1-  6223s   2 BABBzdef f(x): foo)(zdef f(x): global xpasss   spamr   N)r   r|   	TypeError	bytearray
memoryviewlist)r)   r   s   f r   test_filename_correct"SymtableTest.test_filename_correct  s    	C 	',*B/&'62y))fi&8&A *y))fj&96B *y))fd7mV< *)	 *))))))s$   "D	"D"D/	D	D,	/E 	c                6    \         P                   ! R RR4      pR# )42r   evalNr   r)   symbolss   & r   	test_evalSymtableTest.test_eval  s    ##D#v6r   c                6    \         P                   ! R RR4      pR# )r   r   singleNr   r   s   & r   test_singleSymtableTest.test_single  s    ##D#x8r   c                6    \         P                   ! R RR4      pR# )zdef f(x): return xr   r   Nr   r   s   & r   	test_execSymtableTest.test_exec  s    ##$8#vFr   c                    \         P                   ! \        P                  R 4      RR4      pV P                  \	        VR4      4       Rp\         P                   ! VRR4      pV P                  \	        VR4      4       R# )utf8r   r   r   s+   # -*- coding: iso8859-15 -*-
class : pass
u   ŽN)r   	TEST_CODEencodeassertIsNotNoner   )r)   r#   codes   &  r   
test_bytesSymtableTest.test_bytes  sd    	 0 0 8#vFZV45Bc62ZX67r   c                    V P                  \        V P                  4      R 4       V P                  \        V P                  4      R4       R# )z<SymbolTable for module ?>z$<Function SymbolTable for spam in ?>N)r"   strr#   r   r(   s   &r   test_symtable_reprSymtableTest.test_symtable_repr  s4    TXX(DETYY)OPr   c                .   V P                  \        V P                  P                  R 4      4      R4       V P                  \        V P                  P                  R4      4      R4       V P                  \        V P                  P                  R4      4      R4       V P                  \        V P                  P                  R4      4      R4       V P                  \        V P                  P                  R4      4      R	4       V P                  \        V P                  P                  R
4      4      R4       V P                  \        V P
                  P                  R4      4      R4       V P                  \        V P                  P                  R4      4      R4       \        P                  ! RRR4      pV P                  \        VP                  R
4      4      R4       \        P                  ! RRR4      pV P                  \        VP                  R
4      4      R4       \        P                  ! RRR4      pVP                  4       ^,          pVP                  4       ^ ,          pV P                  \        VP                  R
4      4      R4       R# )rM   z%<symbol 'glob': GLOBAL_IMPLICIT, USE>rL   z5<symbol 'bar': GLOBAL_EXPLICIT, DEF_GLOBAL|DEF_LOCAL>rF   z<symbol 'a': LOCAL, DEF_PARAM>r   z)<symbol 'internal': LOCAL, USE|DEF_LOCAL>r   z+<symbol 'other_internal': LOCAL, DEF_LOCAL>rK   z<symbol 'x': FREE, USE>rJ   z5<symbol 'some_var': FREE, USE|DEF_NONLOCAL|DEF_LOCAL>r   z-<symbol 'T': LOCAL, DEF_LOCAL|DEF_TYPE_PARAM>[x for x in [1]]r   r   z0<symbol 'x': LOCAL, USE|DEF_LOCAL|DEF_COMP_ITER>z[(lambda: x) for x in [1]]z9<symbol 'x': CELL, DEF_LOCAL|DEF_COMP_ITER|DEF_COMP_CELL>zTdef f():
   x = 1
   class A:
       x = 2
       def method():
           return x
z-<symbol 'x': LOCAL, DEF_LOCAL|DEF_FREE_CLASS>N)	r"   reprr   r[   r   r   r   r   r   )r)   r   r   r   func_fclass_As   &     r   test_symbol_reprSymtableTest.test_symbol_repr  s   dii..v67@	Bdii..u56P	Rdii..s349	;dii..z:;D	Fdii../?@AF	Hdmm223782	4d1188DEP	Rd..55c:;H	J  2C@cjjo.K	M  <c6Jcjjo.T	V  !8 !$V- !!#A&%%'*gnnS12H	Jr   c                    R V P                   P                  4        RV P                   P                  4        R2pV P                  \	        V P                   P
                  4      V4       R# )z<symtable entry top(z), line >N)r#   r0   rB   r"   r  _tablerc   s   & r   test_symtable_entry_repr%SymtableTest.test_symtable_entry_repr  sN    )$((//*;)<HTXXEXEXEZD[[\]dhhoo.9r   r   N)5__name__
__module____qualname____firstlineno__r   r   r#   r   r   r   r   r   r   r   r   r   r%   r   r&   r   r'   r   r   r*   r1   r7   r;   r?   rC   rV   r^   rd   rh   rl   rp   ru   r~   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  __static_attributes____classdictcell____classdict__s   @r   r   r      so    


IsF
3Cc6"D$
+Hc6"D$
+H&67N
S%
 CsG$Ec>2L#L.Ac>2L#L.AS-0K";>;$A;$A="
92
32
5<
QHP=@
?
A?"B06>7OIb=,79G8Q%JN: :r   r   c                   ,   a  ] tR tRt o R tR tRtV tR# )ComprehensionTestsi  c                    VP                  VP                  4       4       VP                  4        F  pV P                  W24       K  	  R # r   )extendrz   r   get_identifiers_recursive)r)   stresr
   s   &&& r   r  ,ComprehensionTests.get_identifiers_recursive  s6    

2%%'(//#B**23 $r   c                T   . ROpV F  pV P                  VR7      ;_uu_ 4        \        P                  ! VRR4      p. pV P                  W44       T P                  \	        V Uu. uF  qUR8X  g   K  VNK  	  up4      ^4       RRR4       K  	  R# u upi   + '       g   i     K  ; i)r  )compr   r   rK   N)r  z{x for x in [1]}z{x:x*x for x in [1]})r   r   r  r"   ry   )r)   compsr"  r  idsrK   s   &     r   test_loopvar_in_only_one_scope1ComprehensionTests.test_loopvar_in_only_one_scope  s    

 D4((&&tS&9..r7  %AASaa%A!BAF	 )( 
 &B	 )((s$   A B$B1B7BBB'r   N)r  r  r  r  r  r%  r  r  r  s   @r   r  r    s     4
G Gr   r  c                   0   a  ] tR tRt o RtR tR tRtV tR# )CommandLineTesti(  Nc                   \         P                  pV P                  \         P                  V4       \	        VR 4      ;_uu_ 4       pVP                  \        4       RRR4       \        P                  ! 4       ;_uu_ 4       p\        P                  ! V.4       RRR4       XP                  4       pV P                  RV4       V P                  RV4       VP                  4       pV P                  RV: R2V4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  R	V4       R#   + '       g   i     L; i  + '       g   i     L; i)
wNz

z


z"symbol table for module from file :z"    local symbol 'glob': def_localz*        global_implicit symbol 'glob': usez"    local symbol 'spam': def_localz%    symbol table for function 'spam':)r   TESTFN
addCleanupunlinkopenwriter   r   captured_stdoutr   maingetvalueassertInassertNotIn
splitlines)r)   r   fstdoutoutliness   &     r   	test_fileCommandLineTest.test_file+  s    ##	(((3(C  AGGI !$$&&&MM8*% 'oofc"3' :8,aH%P:EBBEJ:EB=uE ! &&s   E EE	E(	c           	        \         P                  ! 4       ;_uu_ 4       pVP                  \        4       VP	                  ^ 4       \         P
                  ! 4       ;_uu_ 4       p\        P                  ! . 4       RRR4       XP                  4       pVP	                  ^ 4       \         P
                  ! 4       ;_uu_ 4       p\        P                  ! R.4       RRR4       V P                  VP                  4       V4       RRR4       XP                  4       pV P                  RV4       R#   + '       g   i     L; i  + '       g   i     Lo; i  + '       g   i     LZ; i)r.   N-z,symbol table for module from file '<stdin>':)r   captured_stdinr0  r   seekr1  r   r2  r3  r"   r6  r4  )r)   stdinr8  r9  r:  s   &    r   
test_stdinCommandLineTest.test_stdin<  s    ##%%KK	"JJqM((**fb! +//#CJJqM((**fse$ +V__.4 &  DeL +* +* &%s=   AE"D+	9AE?D>	(E+D;6E>E	EE!	r   )	r  r  r  r  maxDiffr;  rB  r  r  r  s   @r   r(  r(  (  s     GF"M Mr   r(  __main__)__doc__r   r   r   unittestr   r   test.supportr   r   r   r   TestCaser   r  r(  r  r2  r   r   r   <module>rJ     s    
     "+	Zp f\:8$$ \:~
G** G* Mh''  MF zMMO r   