[docs] Add documentation for typing.Generator (issue 27689)

guido at python.org guido at python.org
Fri Aug 5 14:25:14 EDT 2016


http://bugs.python.org/review/27689/diff/18074/Doc/library/typing.rst
File Doc/library/typing.rst (right):

http://bugs.python.org/review/27689/diff/18074/Doc/library/typing.rst#newcode474
Doc/library/typing.rst:474: while sent is not None:
On 2016/08/05 20:15:15, levkivskyi wrote:
> One more comment: One might be confused why send type is float and not
> Optional[float], maybe you could add an explanation that one anyway
can only
> send None as a first value, so that Optional is redundant.

Hm, that initial None is not given to yield (it just starts execution of
the generator body). This code really needs Optional[float] in the
signature, if that's used as the sentinel (once we have strict optional
checking).

http://bugs.python.org/review/27689/


More information about the docs mailing list