MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _check_prefix

Method _check_prefix

tools/python-3.11.9-amd64/Lib/doctest.py:801–810  ·  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

799 line[indent:indent+3], line))
800
801 def _check_prefix(self, lines, prefix, name, lineno):
802 """
803 Check that every line in the given list starts with the given
804 prefix; if any line does not, then raise a ValueError.
805 """
806 for i, line in enumerate(lines):
807 if line and not line.startswith(prefix):
808 raise ValueError('line %r of the docstring for %s has '
809 'inconsistent leading whitespace: %r' %
810 (lineno+i+1, name, line))
811
812
813######################################################################

Callers 1

_parse_exampleMethod · 0.95

Calls 2

enumerateFunction · 0.85
startswithMethod · 0.80

Tested by

no test coverage detected