@@ -930,14 +930,14 @@ def test_coroutine(self):
930
930
pass
931
931
932
932
def test_async_iterable (self ):
933
- base_it = range (10 ) # type: Iterator[int]
933
+ base_it : Iterator [ int ] = range (10 )
934
934
it = AsyncIteratorWrapper (base_it )
935
935
self .assertIsInstance (it , typing_extensions .AsyncIterable )
936
936
self .assertIsInstance (it , typing_extensions .AsyncIterable )
937
937
self .assertNotIsInstance (42 , typing_extensions .AsyncIterable )
938
938
939
939
def test_async_iterator (self ):
940
- base_it = range (10 ) # type: Iterator[int]
940
+ base_it : Iterator [ int ] = range (10 )
941
941
it = AsyncIteratorWrapper (base_it )
942
942
self .assertIsInstance (it , typing_extensions .AsyncIterator )
943
943
self .assertNotIsInstance (42 , typing_extensions .AsyncIterator )
@@ -1697,7 +1697,7 @@ class Concrete(Proto):
1697
1697
def test_none_treated_correctly (self ):
1698
1698
@runtime
1699
1699
class P (Protocol ):
1700
- x = None # type: int
1700
+ x : int = None
1701
1701
class B (object ): pass
1702
1702
self .assertNotIsInstance (B (), P )
1703
1703
class C :
@@ -1717,7 +1717,7 @@ def __init__(self):
1717
1717
1718
1718
def test_protocols_in_unions (self ):
1719
1719
class P (Protocol ):
1720
- x = None # type: int
1720
+ x : int = None
1721
1721
Alias = typing .Union [typing .Iterable , P ]
1722
1722
Alias2 = typing .Union [P , typing .Iterable ]
1723
1723
self .assertEqual (Alias , Alias2 )
@@ -2388,7 +2388,7 @@ def test_canonical_usage_with_variable_annotation(self):
2388
2388
exec ('Alias: TypeAlias = Employee' , globals (), ns )
2389
2389
2390
2390
def test_canonical_usage_with_type_comment (self ):
2391
- Alias = Employee # type: TypeAlias
2391
+ Alias : TypeAlias = Employee
2392
2392
2393
2393
def test_cannot_instantiate (self ):
2394
2394
with self .assertRaises (TypeError ):
0 commit comments