File tree 2 files changed +4
-4
lines changed 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -145,8 +145,8 @@ def visit_union_type(self, left: UnionType) -> bool:
145
145
if isinstance (self .right , UnionType ):
146
146
# fast path for simple literals
147
147
def _extract_literals (u : UnionType ) -> Tuple [Set [LiteralType ], List [Type ]]:
148
- lit = set () # type : Set[LiteralType]
149
- rem = [] # type: List[Type ]
148
+ lit : Set [LiteralType ] = set ()
149
+ rem : List [ Type ] = [ ]
150
150
for i in u .items :
151
151
if is_simple_literal (i ):
152
152
assert isinstance (i , LiteralType ) # type: ignore[misc]
Original file line number Diff line number Diff line change @@ -499,7 +499,7 @@ def visit_overloaded(self, left: Overloaded) -> bool:
499
499
500
500
def visit_union_type (self , left : UnionType ) -> bool :
501
501
if isinstance (self .right , Instance ):
502
- literal_types = set () # type : Set[Instance]
502
+ literal_types : Set [Instance ] = set ()
503
503
# avoid redundant check for union of literals
504
504
for item in left .items :
505
505
if mypy .typeops .is_simple_literal (item ):
@@ -1151,7 +1151,7 @@ def report(*args: Any) -> None:
1151
1151
1152
1152
1153
1153
def try_restrict_literal_union (t : UnionType , s : Type ) -> Optional [List [Type ]]:
1154
- new_items = [] # type: List[Type ]
1154
+ new_items : List [ Type ] = [ ]
1155
1155
for i in t .relevant_items ():
1156
1156
it = get_proper_type (i )
1157
1157
if not mypy .typeops .is_simple_literal (it ):
You can’t perform that action at this time.
0 commit comments