1212from typing import TypeVar , AnyStr
1313from typing import T , KT , VT # Not in __all__.
1414from typing import Union , Optional
15- from typing import Tuple , List , MutableMapping
15+ from typing import Tuple , List , MutableMapping , Iterator
1616from typing import Callable
1717from typing import Generic , ClassVar , GenericMeta
1818from typing import cast
@@ -1539,7 +1539,7 @@ def test_syntax_error(self):
15391539
15401540 def test_delayed_syntax_error (self ):
15411541
1542- def foo (a : 'Node[T' ):
1542+ def foo (a : 'Node[T' ): # noqa
15431543 pass
15441544
15451545 with self .assertRaises (SyntaxError ):
@@ -1555,7 +1555,7 @@ def foo(a: Tuple['42']):
15551555
15561556 def test_name_error (self ):
15571557
1558- def foo (a : 'Noode[T]' ):
1558+ def foo (a : 'Noode[T]' ): # noqa
15591559 pass
15601560
15611561 with self .assertRaises (NameError ):
@@ -1564,7 +1564,7 @@ def foo(a: 'Noode[T]'):
15641564 def test_no_type_check (self ):
15651565
15661566 @no_type_check
1567- def foo (a : 'whatevers' ) -> {}:
1567+ def foo (a : 'whatevers' ) -> {}: # noqa
15681568 pass
15691569
15701570 th = get_type_hints (foo )
@@ -1574,7 +1574,7 @@ def test_no_type_check_class(self):
15741574
15751575 @no_type_check
15761576 class C :
1577- def foo (a : 'whatevers' ) -> {}:
1577+ def foo (a : 'whatevers' ) -> {}: # noqa
15781578 pass
15791579
15801580 cth = get_type_hints (C .foo )
@@ -1600,12 +1600,12 @@ def magic_decorator(deco):
16001600 self .assertEqual (magic_decorator .__name__ , 'magic_decorator' )
16011601
16021602 @magic_decorator
1603- def foo (a : 'whatevers' ) -> {}:
1603+ def foo (a : 'whatevers' ) -> {}: # noqa
16041604 pass
16051605
16061606 @magic_decorator
16071607 class C :
1608- def foo (a : 'whatevers' ) -> {}:
1608+ def foo (a : 'whatevers' ) -> {}: # noqa
16091609 pass
16101610
16111611 self .assertEqual (foo .__name__ , 'foo' )
@@ -1764,7 +1764,7 @@ async def g_with(am: AsyncContextManager[int]):
17641764 # fake names for the sake of static analysis
17651765 ann_module = ann_module2 = ann_module3 = None
17661766 A = B = CSub = G = CoolEmployee = CoolEmployeeWithDefault = object
1767- XMeth = XRepr = NoneAndForward = object
1767+ XMeth = XRepr = NoneAndForward = HasForeignBaseClass = object
17681768
17691769gth = get_type_hints
17701770
@@ -1826,7 +1826,7 @@ def test_respect_no_type_check(self):
18261826 @no_type_check
18271827 class NoTpCheck :
18281828 class Inn :
1829- def __init__ (self , x : 'not a type' ): ...
1829+ def __init__ (self , x : 'not a type' ): ... # noqa
18301830 self .assertTrue (NoTpCheck .__no_type_check__ )
18311831 self .assertTrue (NoTpCheck .Inn .__init__ .__no_type_check__ )
18321832 self .assertEqual (gth (ann_module2 .NTC .meth ), {})
@@ -2233,8 +2233,8 @@ def __len__(self):
22332233 self .assertIsSubclass (MMB [str , str ], typing .Mapping )
22342234 self .assertIsSubclass (MMC , MMA )
22352235
2236- class I (typing .Iterable ): ...
2237- self .assertNotIsSubclass (list , I )
2236+ class It (typing .Iterable ): ...
2237+ self .assertNotIsSubclass (list , It )
22382238
22392239 class G (typing .Generator [int , int , int ]): ...
22402240 def g (): yield 0
@@ -2316,8 +2316,8 @@ class S(collections_abc.MutableSequence): ...
23162316 self .assertIsSubclass (S , typing .MutableSequence )
23172317 self .assertIsSubclass (S , typing .Iterable )
23182318
2319- class I (collections_abc .Iterable ): ...
2320- self .assertIsSubclass (I , typing .Iterable )
2319+ class It (collections_abc .Iterable ): ...
2320+ self .assertIsSubclass (It , typing .Iterable )
23212321
23222322 class A (collections_abc .Mapping , metaclass = abc .ABCMeta ): ...
23232323 class B : ...
0 commit comments