Shortcuts

example_generator

class docs_example.style_guide.example_generator(n)[source]

Generators have a Yields section instead of a Returns section.

Parameters

n (int) – The upper limit of the range to generate, from 0 to n - 1.

Yields

int – The next number in the range of 0 to n - 1.

Examples

Examples should be written in doctest format, and should illustrate how to use the function.

>>> print([i for i in example_generator(4)])
[0, 1, 2, 3]
Read the Docs v: latest
Versions
latest
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.