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

Method _check_prefix

Lib/doctest.py:822–831  ·  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

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

Callers 1

_parse_exampleMethod · 0.95

Calls 2

enumerateFunction · 0.85
startswithMethod · 0.45

Tested by

no test coverage detected