@@ -151,20 +151,18 @@ def _is_name_or_attr(node, name): # type: (ast.AST, str) -> bool
151
151
152
152
153
153
def _must_match (regex , string , pos ):
154
- # type: (Pattern[str], str, int) -> Match[str]
155
154
match = regex .match (string , pos )
156
155
assert match is not None
157
156
return match
158
157
159
158
160
- def parse_percent_format (s ): # type: (str) -> Tuple[PercentFormat, ...]
159
+ def parse_percent_format (s ):
161
160
"""Parses the string component of a `'...' % ...` format call
162
161
163
162
Copied from https://github.com/asottile/pyupgrade at v1.20.1
164
163
"""
165
164
166
165
def _parse_inner ():
167
- # type: () -> Generator[PercentFormat, None, None]
168
166
string_start = 0
169
167
string_end = 0
170
168
in_fmt = False
@@ -184,7 +182,7 @@ def _parse_inner():
184
182
else :
185
183
key_match = MAPPING_KEY_RE .match (s , i )
186
184
if key_match :
187
- key = key_match .group (1 ) # type: Optional[str]
185
+ key = key_match .group (1 )
188
186
i = key_match .end ()
189
187
else :
190
188
key = None
@@ -814,8 +812,8 @@ class _TypeableVisitor(ast.NodeVisitor):
814
812
https://www.python.org/dev/peps/pep-0484/#type-comments
815
813
"""
816
814
def __init__ (self ):
817
- self .typeable_lines = [] # type: List[int]
818
- self .typeable_nodes = {} # type: Dict[int, ast.AST]
815
+ self .typeable_lines = []
816
+ self .typeable_nodes = {}
819
817
820
818
def _typeable (self , node ):
821
819
# if there is more than one typeable thing on a line last one wins
0 commit comments