[issue31700] one-argument version for Generator.typing

2021-11-30 Thread Zeth
Zeth added the comment: I don't get why this is closed. It is a bug. The Generator type annotation works differently than the others, it shouldn't. Sebastian Rittau is correct here, the closer doesn't seem to have understood. As for using Iterator instead as the documentation suggests,

[issue31700] one-argument version for Generator.typing

2017-11-02 Thread Sebastian Rittau
Sebastian Rittau added the comment: Sorry for not responding, but I didn't know what I could have added that I didn't already say in the opening post. Of course, you can use workaround like using the three-argument version or creating aliases. Using Iterator is of course

[issue31700] one-argument version for Generator.typing

2017-11-02 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Since there is no response for few weeks I assume this works for you. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue31700] one-argument version for Generator.typing

2017-10-06 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: You can use Iterator type, for example this works in mypy (didn't test in other type checkers): def f() -> Iterator[int]: yield 42 In case you want annotate something specifically as Generator[int, None, None] (for example to

[issue31700] one-argument version for Generator.typing

2017-10-05 Thread Sebastian Rittau
New submission from Sebastian Rittau : 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: