MCPcopy Index your code
hub / github.com/python/cpython / get_identifiers

Method get_identifiers

Lib/string/__init__.py:176–190  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

174 return True
175
176 def get_identifiers(self):
177 ids = []
178 for mo in self.pattern.finditer(self.template):
179 named = mo.group('named') or mo.group('braced')
180 if named is not None and named not in ids:
181 # add a named group only the first time it appears
182 ids.append(named)
183 elif (named is None
184 and mo.group('invalid') is None
185 and mo.group('escaped') is None):
186 # If all the groups are None, there must be
187 # another group we're not expecting
188 raise ValueError('Unrecognized named group in pattern',
189 self.pattern)
190 return ids
191
192
193########################################################################

Callers 7

test_symbol_lookupMethod · 0.45
test_lambdaMethod · 0.45
test_nested_lambdaMethod · 0.45
test_genexprMethod · 0.45
test_nested_genexprMethod · 0.45
test_get_identifiersMethod · 0.45

Calls 2

groupMethod · 0.45
appendMethod · 0.45

Tested by 7

test_symbol_lookupMethod · 0.36
test_lambdaMethod · 0.36
test_nested_lambdaMethod · 0.36
test_genexprMethod · 0.36
test_nested_genexprMethod · 0.36
test_get_identifiersMethod · 0.36