Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/test/__pycache__/test_scope.cpython-39.opt-1.pyc

a

��gSO�@sRddlZddlZddlmZmZddlmZGdd�dej�ZedkrNe�	�dS)�N)�check_syntax_error�cpython_only)�
gc_collectc@sHeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zed-d.��Zd/d0�Zed1d2��Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"d?d@�Z#dAdB�Z$dCdD�Z%dEdF�Z&dGdH�Z'dIdJ�Z(edKdL��Z)dMS)N�
ScopeTestscCs<dd�}|d�}|d�}|�|d�d�|�|d�d�dS)Ncs�fdd�}|S)Ncs�|S�N���y��xr�+/usr/local/lib/python3.9/test/test_scope.py�adder
sz?ScopeTests.testSimpleNesting.<locals>.make_adder.<locals>.adderr�rr
rr
r�
make_addersz0ScopeTests.testSimpleNesting.<locals>.make_adder��
�������assertEqual)�selfr�inc�plus10rrr�testSimpleNesting
s
zScopeTests.testSimpleNestingcCs<dd�}|d�}|d�}|�|d�d�|�|d�d�dS)Ncs�fdd�}|�S)Ncs�fdd�}|S)Ncs�|Srrrr
rrr
szNScopeTests.testExtraNesting.<locals>.make_adder2.<locals>.extra.<locals>.adderr�r
r
rr�extrasz?ScopeTests.testExtraNesting.<locals>.make_adder2.<locals>.extrar)rrrr
r�make_adder2sz0ScopeTests.testExtraNesting.<locals>.make_adder2rrrrrr)rrrrrrr�testExtraNestings
zScopeTests.testExtraNestingcCs<dd�}|d�}|d�}|�|d�d�|�|d�d�dS)	Ncs�fdd�}�d�|S)Ncs�|Srrrr
rrr
)szEScopeTests.testSimpleAndRebinding.<locals>.make_adder3.<locals>.adderrrrrr
r�make_adder3(sz6ScopeTests.testSimpleAndRebinding.<locals>.make_adder3r�	rrrrr)rrrrrrr�testSimpleAndRebinding&s
z!ScopeTests.testSimpleAndRebindingcs>�fdd�}d�|�}|�|d�d�d�|�|d�d�dS)Ncs�fdd�}|�S)Ncs�fdd�}|�S)Ncs�fdd�}|S)Ncs�|Srrr�Zglobal_xrrr
9szbScopeTests.testNestingGlobalNoFree.<locals>.make_adder4.<locals>.nest.<locals>.nest.<locals>.adderrrr"rr�nest8szSScopeTests.testNestingGlobalNoFree.<locals>.make_adder4.<locals>.nest.<locals>.nestr�r#r"rrr#7szEScopeTests.testNestingGlobalNoFree.<locals>.make_adder4.<locals>.nestrr$r"rr�make_adder46sz7ScopeTests.testNestingGlobalNoFree.<locals>.make_adder4rrrrrr)rr%r
rr"r�testNestingGlobalNoFree4s	z"ScopeTests.testNestingGlobalNoFreecCs<dd�}|d�}|d�}|�|d�d�|�|d�d�dS)NcsG�fdd�d�}|�S)NcseZdZ�fdd�ZdS)zFScopeTests.testNestingThroughClass.<locals>.make_adder5.<locals>.Addercs�|Srr)rr	r
rr�__call__JszOScopeTests.testNestingThroughClass.<locals>.make_adder5.<locals>.Adder.__call__N)�__name__�
__module__�__qualname__r'rr
rr�AdderIsr+r)rr+rr
r�make_adder5Hsz7ScopeTests.testNestingThroughClass.<locals>.make_adder5rrrrrr)rr,rrrrr�testNestingThroughClassFs
z"ScopeTests.testNestingThroughClasscCs<dd�}|d�}|d�}|�|d�d�|�|d�d�dS)NcSsdd�}|a|S)NcSst|Sr�Z
global_nest_xrrrrr
XszMScopeTests.testNestingPlusFreeRefToGlobal.<locals>.make_adder6.<locals>.adderr.rrrr�make_adder6Vsz>ScopeTests.testNestingPlusFreeRefToGlobal.<locals>.make_adder6rr�rrr)rr/rrrrr�testNestingPlusFreeRefToGlobalTs
z)ScopeTests.testNestingPlusFreeRefToGlobalcCs$dd�}|d�}|�|d�d�dS)NcSsdd�}|d�S)Ncsd��fdd�}|S)N�*cs�|Srr��zr
rr�hhszEScopeTests.testNearestEnclosingScope.<locals>.f.<locals>.g.<locals>.hr)r	r5rr
r�gfsz:ScopeTests.testNearestEnclosingScope.<locals>.f.<locals>.grr�rr6rrr�fesz/ScopeTests.testNearestEnclosingScope.<locals>.fr��/r)rr8Z	test_funcrrr�testNearestEnclosingScopecsz$ScopeTests.testNearestEnclosingScopecs>dd���fdd�}|ddd�}|ddd	�}|�|�d
�dS)NcSs|Srrr
rrr�identityrsz9ScopeTests.testMixedFreevarsAndCellvars.<locals>.identitycs���fdd�}|S)Ncs&|�}����fdd�}|��|S)Ncs�����Srrr)�br<r	r4rrr5xszHScopeTests.testMixedFreevarsAndCellvars.<locals>.f.<locals>.g.<locals>.hr)�ar=�cr5)r<rr4)r=r	rr6vsz=ScopeTests.testMixedFreevarsAndCellvars.<locals>.f.<locals>.gr)rr	r4r6�r<)rr4rr8usz2ScopeTests.testMixedFreevarsAndCellvars.<locals>.frr����'r�rr8r6r5rr@r�testMixedFreevarsAndCellvarsps
z'ScopeTests.testMixedFreevarsAndCellvarscs�dd�}|�}|�|��d�|�|��d�|�|��d�d�G�fdd�d�}|�}|�|��d�|�|��d�|�|��d�dS)Ncsd�G�fdd�d�}|�S)N�varcs0eZdZdd�Z�fdd�Zdd�Zdd�Zd	S)
z:ScopeTests.testFreeVarInMethod.<locals>.test.<locals>.TestcSsdS�N�methodr�rrrr�method_and_var�szIScopeTests.testFreeVarInMethod.<locals>.test.<locals>.Test.method_and_varcs�SrrrJ�rKrr�test�sz?ScopeTests.testFreeVarInMethod.<locals>.test.<locals>.Test.testcSstd�S�N�global��strrJrrr�
actual_global�szHScopeTests.testFreeVarInMethod.<locals>.test.<locals>.Test.actual_globalcSst|�SrrPrJrrrrQ�sz>ScopeTests.testFreeVarInMethod.<locals>.test.<locals>.Test.strN�r(r)r*rKrMrRrQrrLrr�Test�srTr)rTrrLrrM�s	z,ScopeTests.testFreeVarInMethod.<locals>.testrGrIrOcs0eZdZdd�Z�fdd�Zdd�Zdd�Zd	S)
z,ScopeTests.testFreeVarInMethod.<locals>.TestcSsdSrHrrJrrrrK�sz;ScopeTests.testFreeVarInMethod.<locals>.Test.method_and_varcs�SrrrJrLrrrM�sz1ScopeTests.testFreeVarInMethod.<locals>.Test.testcSstd�SrNrPrJrrrrR�sz:ScopeTests.testFreeVarInMethod.<locals>.Test.actual_globalcSst|�SrrPrJrrrrQ�sz0ScopeTests.testFreeVarInMethod.<locals>.Test.strNrSrrLrrrT�srT)rrMrKrR)rrM�trTrrLr�testFreeVarInMethod�s
zScopeTests.testFreeVarInMethodcCs2dd�dd�}|�|dd�d�|�|�d�dS)N��r>cs�fdd�}|�dS)Ncs�dS)Nr9rrrXrr�bar�sz8ScopeTests.testCellIsKwonlyArg.<locals>.foo.<locals>.barrAr)r>rYrrXr�foo�sz+ScopeTests.testCellIsKwonlyArg.<locals>.foor2�2�r)rrZrrr�testCellIsKwonlyArg�szScopeTests.testCellIsKwonlyArgcCsdd�}|�|d�d�dS)Ncs(�fdd��|dkr�|�Std��dS)Ncs |dkrdS|�|d�SdS)Nrrr)�n��factrrr`�sz1ScopeTests.testRecursion.<locals>.f.<locals>.factrzx must be >= 0)�
ValueErrorr
rr_rr8�sz#ScopeTests.testRecursion.<locals>.frCi�r�rr8rrr�
testRecursion�szScopeTests.testRecursioncCs,t|d�t|d�t|d�t|d�dS)Nz�if 1:
            def unoptimized_clash1(strip):
                def f(s):
                    from sys import *
                    return getrefcount(s) # ambiguity: free or local
                return f
            z�if 1:
            def unoptimized_clash2():
                from sys import *
                def f(s):
                    return getrefcount(s) # ambiguity: global or local
                return f
            z�if 1:
            def unoptimized_clash2():
                from sys import *
                def g():
                    def f(s):
                        return getrefcount(s) # ambiguity: global or local
                    return f
            z�if 1:
            def f():
                def g():
                    from sys import *
                    return getrefcount # global or local?
            )rrJrrr�testUnoptimizedNamespaces�s


	z$ScopeTests.testUnoptimizedNamespacesc	s�dd�}|d�}|d�}|�|d�d�|�|d�d�dd�}|d�}|d�}|�|d�d�|�|d�d��fd	d�}d�|d�}|�|d�d
�dd�}|ddd
�}|ddd
�}|�|�d�dS)Ncs�fdd�S)Ncs�|Srrrr
rr�<lambda>���:ScopeTests.testLambdas.<locals>.<lambda>.<locals>.<lambda>rr
rr
rre�rfz(ScopeTests.testLambdas.<locals>.<lambda>rrrr9�cs�fdd��S)Ncs�fdd�S)Ncs�|Srrrr
rrre�rf�LScopeTests.testLambdas.<locals>.<lambda>.<locals>.<lambda>.<locals>.<lambda>rrr
rrre�rfrgrr
rr
rre�rfcs�fdd�S)Ncs�|Srrrr"rrre�rfrgrr
r"rrre�rfrAcs��fdd�S)Ncs���fdd�S)Ncs���Srrr)r=r	r4rrre�rfrir�r>r=r?�r	r4)r=rre�rfrgr)rr	r4rrkrre�rfrBrC�r)	r�f1rr�f2Zf3Zf8r6r5rr"r�testLambdas�s$zScopeTests.testLambdascCs,dd�}dd�}|�t|�|�t|�dS)Ncst���fdd�}d�dS)Ncs�Srrrrrr�innersz@ScopeTests.testUnboundLocal.<locals>.errorInOuter.<locals>.innerr��print�rprrr�errorInOutersz1ScopeTests.testUnboundLocal.<locals>.errorInOutercs�fdd�}|�d�dS)Ncs�Srrrrrrrpsz@ScopeTests.testUnboundLocal.<locals>.errorInInner.<locals>.innerrrrsrrr�errorInInnersz1ScopeTests.testUnboundLocal.<locals>.errorInInner��assertRaises�UnboundLocalError�	NameError�rrtrurrr�testUnboundLocal�szScopeTests.testUnboundLocalcCs,dd�}dd�}|�t|�|�t|�dS)Ncsd��t���fdd�}dS)Nrcs�SrrrrrrrpszIScopeTests.testUnboundLocal_AfterDel.<locals>.errorInOuter.<locals>.innerrqrsrrrrtsz:ScopeTests.testUnboundLocal_AfterDel.<locals>.errorInOutercs�fdd�}d��|�dS)Ncs�SrrrrrrrpszIScopeTests.testUnboundLocal_AfterDel.<locals>.errorInInner.<locals>.innerrrrsrrrrusz:ScopeTests.testUnboundLocal_AfterDel.<locals>.errorInInnerrvrzrrr�testUnboundLocal_AfterDelsz$ScopeTests.testUnboundLocal_AfterDelcCstdd|ji�dS)Naif 1:
            global_x = 1
            def f():
                global_x += 1
            try:
                f()
            except UnboundLocalError:
                pass
            else:
                fail('scope of global_x not correctly determined')
            �fail)�execr}rJrrr�testUnboundLocal_AugAssign$s
�z%ScopeTests.testUnboundLocal_AugAssigncCsBdd�}|�|ddd��d�dd�}|�|d	d
��dd	�dS)Ncs�fdd�}|S)Ncs�Srrr��lstrr�returner5szIScopeTests.testComplexDefinitions.<locals>.makeReturner.<locals>.returnerr)r�r�rr�r�makeReturner4sz7ScopeTests.testComplexDefinitions.<locals>.makeReturnerrrrA)rrrAcs�fdd�}|S)Ncs�Srrr��kwargsrrr�<szJScopeTests.testComplexDefinitions.<locals>.makeReturner2.<locals>.returnerr)r�r�rr�r�
makeReturner2;sz8ScopeTests.testComplexDefinitions.<locals>.makeReturner2r0rXr>r)rr�r�rrr�testComplexDefinitions2sz!ScopeTests.testComplexDefinitionscCstd�dS)Na;if 1:
            # I
            x = 7
            def f():
                x = 1
                def g():
                    global x
                    def i():
                        def h():
                            return x
                        return h()
                    return i()
                return g()
            self.assertEqual(f(), 7)
            self.assertEqual(x, 7)

            # II
            x = 7
            def f():
                x = 1
                def g():
                    x = 2
                    def i():
                        def h():
                            return x
                        return h()
                    return i()
                return g()
            self.assertEqual(f(), 2)
            self.assertEqual(x, 7)

            # III
            x = 7
            def f():
                x = 1
                def g():
                    global x
                    x = 2
                    def i():
                        def h():
                            return x
                        return h()
                    return i()
                return g()
            self.assertEqual(f(), 2)
            self.assertEqual(x, 2)

            # IV
            x = 7
            def f():
                x = 3
                def g():
                    global x
                    x = 2
                    def i():
                        def h():
                            return x
                        return h()
                    return i()
                return g()
            self.assertEqual(f(), 2)
            self.assertEqual(x, 2)

            # XXX what about global statements in class blocks?
            # do they affect methods?

            x = 12
            class Global:
                global x
                x = 13
                def set(self, val):
                    x = val
                def get(self):
                    return x

            g = Global()
            self.assertEqual(g.get(), 13)
            g.set(15)
            self.assertEqual(g.get(), 13)
            �r~rJrrr�testScopeOfGlobalStmtBsz ScopeTests.testScopeOfGlobalStmtcsJG�fdd�d���fdd�}td�D]
}|�q&t�|��jd�dS)Ncs(eZdZdZ�fdd�Z�fdd�ZdS)z!ScopeTests.testLeaks.<locals>.Foorcs�jd7_dS�Nr��countrJ��Foorr�__init__�sz*ScopeTests.testLeaks.<locals>.Foo.__init__cs�jd8_dSr�r�rJr�rr�__del__�sz)ScopeTests.testLeaks.<locals>.Foo.__del__N)r(r)r*r�r�r�rr�rrr��sr�cs����fdd�}|�dS)Ncs�Srrrr
rrrn�sz,ScopeTests.testLeaks.<locals>.f1.<locals>.f2r)rnr�r
rrm�sz ScopeTests.testLeaks.<locals>.f1�dr)�rangerrr�)rrm�irr�r�	testLeaks�s	zScopeTests.testLeakscCstd�dS)Na�if 1:
            def test(x):
                class Foo:
                    global x
                    def __call__(self, y):
                        return x + y
                return Foo()

            x = 0
            self.assertEqual(test(6)(2), 8)
            x = -1
            self.assertEqual(test(3)(2), 5)

            looked_up_by_load_name = False
            class X:
                # Implicit globals inside classes are be looked up by LOAD_NAME, not
                # LOAD_GLOBAL.
                locals()['looked_up_by_load_name'] = True
                passed = looked_up_by_load_name

            self.assertTrue(X.passed)
            r�rJrrr�testClassAndGlobal�szScopeTests.testClassAndGlobalcCs>dd�}|d�d�}|�d|�|d=|�|dddd��dS)	Ncs�fdd�}|S)Ncs"�fdd�}��}�d7�t�S)Ncs�|Srrr3rrrr5�sz>ScopeTests.testLocalsFunction.<locals>.f.<locals>.g.<locals>.hrA)�locals)r	r5�wr
rrr6�sz3ScopeTests.testLocalsFunction.<locals>.f.<locals>.grr7rr
rr8�sz(ScopeTests.testLocalsFunction.<locals>.frrBr5�rC)rr	r�)�assertInr)rr8�drrr�testLocalsFunction�s
	zScopeTests.testLocalsFunctioncCsHdd�}|�|d�jd�dd�}|d�j}|�d|�|�d|�dS)NcsG�fdd�d�}|S)Ncs"eZdZdZ�fdd�Ze�dS)�0ScopeTests.testLocalsClass.<locals>.f.<locals>.C�cs�SrrrJr
rr�m�s�2ScopeTests.testLocalsClass.<locals>.f.<locals>.C.mN)r(r)r*rr�r�rr
rr�C�sr�r�rr�rr
rr8�sz%ScopeTests.testLocalsClass.<locals>.frr�csG�fdd�d�}|S)Ncs&eZdZ�Z�fdd�Zee��ZdS)r�cs�SrrrJr
rrr��sr�N)r(r)r*r	r��listr�r4rr
rrr��sr�rr�rr
rr8�srr	)rrr4�assertNotInr�)rr8Zvarnamesrrr�testLocalsClass�s
zScopeTests.testLocalsClasscsNddl}|�|j|���|�dd��d�G�fdd�d�}|��d�dS)NrcSsdSrrrjrrrre�rfz6ScopeTests.testLocalsClass_WithTrace.<locals>.<lambda>r�cseZdZ�fdd�ZdS)z/ScopeTests.testLocalsClass_WithTrace.<locals>.Ccs�SrrrJr
rrr8sz1ScopeTests.testLocalsClass_WithTrace.<locals>.C.fN)r(r)r*r8rr
rrr�sr�)�sys�
addCleanup�settrace�gettracer)rr�r�rr
r�testLocalsClass_WithTrace�sz$ScopeTests.testLocalsClass_WithTracecCs(dd�}|d��}|�|j|���dS)NcsG�fdd�d�}|S)NcseZdZ�fdd�Z�ZdS)z1ScopeTests.testBoundAndFree.<locals>.f.<locals>.Ccs�SrrrJr
rrr�
sz3ScopeTests.testBoundAndFree.<locals>.f.<locals>.C.mN)r(r)r*r�r>rr
rrr�sr�rr�rr
rr8sz&ScopeTests.testBoundAndFree.<locals>.frA)rr>r�)rr8�instrrr�testBoundAndFrees
zScopeTests.testBoundAndFreecsnddl}�fdd��dd�}Gdd�d�}|�|j|���|���|d|d	�|�d�|�t|j�dS)
Nrcs�Srrrj��tracerrrr�sz7ScopeTests.testInteractionWithTraceFunc.<locals>.tracercs6|\}�|dkr2�dkr&d|j|f��fdd�SdS)Nr�z_%s__%scs
t|��Sr)�getattr)�obj�Zdesrrre!rfzNScopeTests.testInteractionWithTraceFunc.<locals>.adaptgetter.<locals>.<lambda>)r()�name�klass�getter�kindrr�r�adaptgetters
z<ScopeTests.testInteractionWithTraceFunc.<locals>.adaptgetterc@seZdZdS)z:ScopeTests.testInteractionWithTraceFunc.<locals>.TestClassN)r(r)r*rrrr�	TestClass#sr�rZ)rr�)r�r�r�r�rw�	TypeError)rr�r�r�rr�r�testInteractionWithTraceFuncs

z'ScopeTests.testInteractionWithTraceFunccCsRdd�}|d�}|�tt|j�zt|ji�WntyBYn0|�d�dS)Ncs�fdd�S)Ncs�dSr�rrr
rrre0rfz<ScopeTests.testEvalExecFreeVars.<locals>.f.<locals>.<lambda>rr
rr
rr8/sz*ScopeTests.testEvalExecFreeVars.<locals>.frAz9exec should have failed, because code contained free vars)rwr��eval�__code__r~r}�rr8r6rrr�testEvalExecFreeVars-szScopeTests.testEvalExecFreeVarscCsZztt�WntyYn
0td�dd�}|�ztt�WntyTYn0dS)Nzbad should not be definedcSsdd�dD�dS)NcSsg|]}|��D]}|�qqSr)�split)�.0�s�badrrr�
<listcomp>Frfz?ScopeTests.testListCompLocalVars.<locals>.x.<locals>.<listcomp>za brrrrrrEsz+ScopeTests.testListCompLocalVars.<locals>.x)rrr�ry)rrrrr�testListCompLocalVars<sz ScopeTests.testListCompLocalVarscCsdd�}|d��dS)Ncs�fdd�}|S)Ncs�td�dS)Nzx + 1)r�rr
rrr6Qsz1ScopeTests.testEvalFreeVars.<locals>.f.<locals>.grr7rr
rr8Psz&ScopeTests.testEvalFreeVars.<locals>.frBrrbrrr�testEvalFreeVarsNszScopeTests.testEvalFreeVarscCsGdd�d�}dS)Nc@seZdZdd�ZdS)z+ScopeTests.testFreeingCell.<locals>.SpecialcSs
t�dSr)Znestedcell_getrJrrrr�\sz3ScopeTests.testFreeingCell.<locals>.Special.__del__N)r(r)r*r�rrrr�Special[sr�r)rr�rrr�testFreeingCellXszScopeTests.testFreeingCellcCsPdd�}|d�\}}|�|�d�|�|�d�|�|�d�|�|�d�dS)Ncs �fdd�}�fdd�}||fS)Ncs�d7��Sr�rrr
rrrbsz7ScopeTests.testNonLocalFunction.<locals>.f.<locals>.inccs�d8��Sr�rrr
rr�decfsz7ScopeTests.testNonLocalFunction.<locals>.f.<locals>.decr)rrr�rr
rr8asz*ScopeTests.testNonLocalFunction.<locals>.frrrr)rr8rr�rrr�testNonLocalFunction_szScopeTests.testNonLocalFunctioncCsTdd�}|d�}|�|��d�|�|��d�|�|��d�|�|��d�dS)NcsG�fdd�d�}|�S)Ncs$eZdZ�fdd�Z�fdd�ZdS)z3ScopeTests.testNonLocalMethod.<locals>.f.<locals>.ccs�d7��Sr�rrJr
rrrusz7ScopeTests.testNonLocalMethod.<locals>.f.<locals>.c.inccs�d8��Sr�rrJr
rrr�ysz7ScopeTests.testNonLocalMethod.<locals>.f.<locals>.c.decN)r(r)r*rr�rr
rrr?tsr?r�rr?rr
rr8ss	z(ScopeTests.testNonLocalMethod.<locals>.frrr)rrr��rr8r?rrr�testNonLocalMethodrszScopeTests.testNonLocalMethodcCs8i}i}td||�|�d|d�|�d|d�dS)NaCif 1:
            def f():
                y = 1
                def g():
                    global y
                    return y
                def h():
                    return y + 1
                return g, h
            y = 9
            g, h = f()
            result9 = g()
            result2 = h()
            rZresult2r Zresult9)r~r)rZlocal_nsZ	global_nsrrr�#testGlobalInParallelNestedFunctions�s
�z.ScopeTests.testGlobalInParallelNestedFunctionscCs4dd�}|d�}|�|��d�|�d|jj�dS)NcsG�fdd�d�}|�S)Ncs eZdZ�d7��fdd�ZdS)z2ScopeTests.testNonLocalClass.<locals>.f.<locals>.crcs�SrrrJr
rr�get�sz6ScopeTests.testNonLocalClass.<locals>.f.<locals>.c.getN)r(r)r*r�rr
rrr?�sr?rr�rr
rr8�sz'ScopeTests.testNonLocalClass.<locals>.frrr)rr�r��	__class__�__dict__r�rrr�testNonLocalClass�szScopeTests.testNonLocalClasscCs,dd�}|d�}|�t|d��gd��dS)Ncs�fdd�}|S)Nc3s t|�D]}�d7��VqdSr�)r�)r	r�r
rrr6�sz6ScopeTests.testNonLocalGenerator.<locals>.f.<locals>.grr7rr
rr8�sz+ScopeTests.testNonLocalGenerator.<locals>.frr9)rrrArBr9)rr�r�rrr�testNonLocalGenerator�sz ScopeTests.testNonLocalGeneratorcCs(dd�}|d�}|�}|�|�d�dS)Ncs�fdd�}|S)Ncs�d8��fdd�}|S)Nrcs�d7��S)NrBrrr
rrr5�sz>ScopeTests.testNestedNonLocal.<locals>.f.<locals>.g.<locals>.hr)r5r
rrr6�sz3ScopeTests.testNestedNonLocal.<locals>.f.<locals>.grr7rr
rr8�sz(ScopeTests.testNestedNonLocal.<locals>.frrArrErrr�testNestedNonLocal�szScopeTests.testNestedNonLocalcCsdd�}dd�}dS)NcSsdSrrrXrrr�top�sz/ScopeTests.testTopIsNotSignificant.<locals>.topcSsdSrrrrrrr=�sz-ScopeTests.testTopIsNotSignificant.<locals>.br)rr�r=rrr�testTopIsNotSignificant�sz"ScopeTests.testTopIsNotSignificantcsRd�G�fdd�d�}|�|jd�Gdd�d�}|�t|d��|��d�dS)Nr2cseZdZde�d<�ZdS�z8ScopeTests.testClassNamespaceOverridesClosure.<locals>.X�+rN)r(r)r*r�r	rr
rr�X�s
r�r�c@seZdZde�d<[dSr�)r(r)r*r�rrrrrr��s
r)rr	ZassertFalse�hasattr)rr�rr
r�"testClassNamespaceOverridesClosure�sz-ScopeTests.testClassNamespaceOverridesClosurecCs>Gdd�d�}|�}|��t�|�}~t�|�|��dS)Nc@seZdZdd�ZdS)z'ScopeTests.testCellLeak.<locals>.Testerc
s@zddWn*ty6}z|�_WYd}~n
d}~00d�dS)Nrr)�	Exception�exc)rr�rrJr�dig�s
z+ScopeTests.testCellLeak.<locals>.Tester.digN)r(r)r*r�rrrr�Tester�sr�)r��weakref�refrZassertIsNone)rr�Ztesterr�rrr�testCellLeak�s
	
zScopeTests.testCellLeakN)*r(r)r*rrr!r&r-r1r;rFrVr]rcrdror{r|rr�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrsR

%"T!





r�__main__)
Zunittestr�Ztest.supportrrrZTestCaserr(�mainrrrr�<module>sx

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists