[New-bugs-announce] [issue31700] one-argument version for Generator.typing
Sebastian Rittau
report at bugs.python.org
Thu Oct 5 04:35:17 EDT 2017
New submission from Sebastian Rittau <srittau at rittau.biz>:
Currently typing.Generator requires three arguments: Generator[YieldType, SendType, ReturnType].
At least for me, passing values to a generator is a very rare case. I suggest to allow only one argument to be passed to Generator: Generator[YieldType], where the other arguments default to None. This makes the common case more readable and is less error-prone. (I always forget the second and third argument, since that use case is so uncommon for me.)
----------
messages: 303748
nosy: srittau
priority: normal
severity: normal
status: open
title: one-argument version for Generator.typing
versions: Python 3.7
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31700>
_______________________________________
More information about the New-bugs-announce
mailing list