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

Method _check_prompt_blank

Lib/doctest.py:808–820  ·  view source on GitHub ↗

Given the lines of a source string (including prompts and leading indentation), check to make sure that every prompt is followed by a space character. If any line is not followed by a space character, then raise ValueError.

(self, lines, indent, name, lineno)

Source from the content-addressed store, hash-verified

806 return 0
807
808 def _check_prompt_blank(self, lines, indent, name, lineno):
809 """
810 Given the lines of a source string (including prompts and
811 leading indentation), check to make sure that every prompt is
812 followed by a space character. If any line is not followed by
813 a space character, then raise ValueError.
814 """
815 for i, line in enumerate(lines):
816 if len(line) >= indent+4 and line[indent+3] != ' ':
817 raise ValueError('line %r of the docstring for %s '
818 'lacks blank after %s: %r' %
819 (lineno+i+1, name,
820 line[indent:indent+3], line))
821
822 def _check_prefix(self, lines, prefix, name, lineno):
823 """

Callers 1

_parse_exampleMethod · 0.95

Calls 1

enumerateFunction · 0.85

Tested by

no test coverage detected