class documentation

class ExamplesSection(Section): (source)

Constructor: ExamplesSection(title, key)

View In Hierarchy

Parser for numpydoc examples sections.

E.g. any section that looks like this:
>>> import numpy.matlib
>>> np.matlib.empty((2, 2))    # filled with random data
matrix([[  6.76425276e-320,   9.79033856e-307], # random
        [  7.39337286e-309,   3.22135945e-309]])
>>> np.matlib.empty((2, 2), dtype=int)
matrix([[ 6600475,        0], # random
        [ 6586976, 22740995]])
Method parse Parse DocstringExample objects from the body of this section.

Inherited from Section:

Method __init__ Undocumented
Instance Variable key Undocumented
Instance Variable title Undocumented
Property title_pattern Regular expression pattern matching this section's header.
def parse(self, text: str) -> T.Iterable[DocstringMeta]: (source) ΒΆ

Parse DocstringExample objects from the body of this section.

Parameters
text:strsection body text. Should be cleaned with inspect.cleandoc before parsing.
Returns
T.Iterable[DocstringMeta]Undocumented