[issue38424] typing.Generator shorthand

2019-10-11 Thread Dima Tisnek


Dima Tisnek  added the comment:

Clearly my attention span does not exceed 5 paragraphs, so sorry!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

Actually Serhiy is right, I just checked and found this sentence:
```
Alternatively, annotate your generator as having a return type of either 
Iterable[YieldType] or Iterator[YieldType]
```

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38424] typing.Generator shorthand

2019-10-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is already documented, with examples. I do not think the documentation can 
be made better.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

If you would like to propose a doc fix, then please go ahead and make a PR.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38424] typing.Generator shorthand

2019-10-11 Thread Ivan Levkivskyi


Change by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38424] typing.Generator shorthand

2019-10-09 Thread Dima Tisnek


Dima Tisnek  added the comment:

Actually yes it is sufficient.

I don't know why I didn't think of that!
Perhaps some note in the docs could help other lost children of Python :P

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38424] typing.Generator shorthand

2019-10-09 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Is Iterator[Whatever] not sufficient for you?

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38424] typing.Generator shorthand

2019-10-09 Thread Dima Tisnek


New submission from Dima Tisnek :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com