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

Method _check_prefix

Lib/doctest.py:828–837  ·  view source on GitHub ↗

Check that every line in the given list starts with the given prefix; if any line does not, then raise a ValueError.

(self, lines, prefix, name, lineno)

Source from the content-addressed store, hash-verified

826 line[indent:indent+3], line))
827
828 def _check_prefix(self, lines, prefix, name, lineno):
829 """
830 Check that every line in the given list starts with the given
831 prefix; if any line does not, then raise a ValueError.
832 """
833 for i, line in enumerate(lines):
834 if line and not line.startswith(prefix):
835 raise ValueError('line %r of the docstring for %s has '
836 'inconsistent leading whitespace: %r' %
837 (lineno+i+1, name, line))
838
839
840######################################################################

Callers 1

_parse_exampleMethod · 0.95

Calls 2

enumerateFunction · 0.85
startswithMethod · 0.45

Tested by

no test coverage detected