5.2.6.4 DocTestParser objects

Python 2.2

5.2.6.4 DocTestParser objects

A processing class used to extract interactive examples from a string, and use them to create a DocTest object. New in version 2.4.

DocTestParser defines the following methods:

Extract all doctest examples from the given string, and collect them into a DocTest object.

globs, name, filename, and lineno are attributes for the new DocTest object. See the documentation for DocTest for more information.

Extract all doctest examples from the given string, and return them as a list of Example objects. Line numbers are 0-based. The optional argument name is a name identifying this string, and is only used for error messages.

Divide the given string into examples and intervening text, and return them as a list of alternating Examples and strings. Line numbers for the Examples are 0-based. The optional argument name is a name identifying this string, and is only used for error messages.

See About this document... for information on suggesting changes.