[New-bugs-announce] [issue38424] typing.Generator shorthand

Dima Tisnek report at bugs.python.org
Wed Oct 9 21:39:01 EDT 2019


New submission from Dima Tisnek <dimaqq at gmail.com>:

Currently to annotate a generator, something like `Generator[str, None, None]` is required. Which is a bit confusing and verbose.

Can we allow shorthand, like `Generator[str]` for simple cases?

I'm not entirely certain what the semantics ought to be...
Maybe Generator[t1, t2=Any, t3=None] ?

----------
components: Library (Lib)
messages: 354307
nosy: Dima.Tisnek
priority: normal
severity: normal
status: open
title: typing.Generator shorthand
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38424>
_______________________________________


More information about the New-bugs-announce mailing list