MCPcopy Index your code
hub / github.com/RustPython/RustPython / _invalid

Method _invalid

Lib/string/__init__.py:109–119  ·  view source on GitHub ↗
(self, mo)

Source from the content-addressed store, hash-verified

107 # Search for $$, $identifier, ${identifier}, and any bare $'s
108
109 def _invalid(self, mo):
110 i = mo.start('invalid')
111 lines = self.template[:i].splitlines(keepends=True)
112 if not lines:
113 colno = 1
114 lineno = 1
115 else:
116 colno = i - len(''.join(lines[:-1]))
117 lineno = len(lines)
118 raise ValueError('Invalid placeholder in string: line %d, col %d' %
119 (lineno, colno))
120
121 def substitute(self, mapping=_sentinel_dict, /, **kws):
122 if mapping is _sentinel_dict:

Callers 1

convertMethod · 0.95

Calls 4

lenFunction · 0.85
startMethod · 0.45
splitlinesMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected