How to type annotate never ending generators? #960
Replies: 4 comments 2 replies
-
I don't think this is currently possible, or at least well-defined, although your solution feels "natural" to me. Maybe this is something that type checkers could implement? |
Beta Was this translation helpful? Give feedback.
-
See microsoft/pyright#2598 cc @erictraut |
Beta Was this translation helpful? Give feedback.
-
There is no example of NoReturn with generators in PEP 484 either https://www.python.org/dev/peps/pep-0484/#the-noreturn-type |
Beta Was this translation helpful? Give feedback.
-
Perhaps the authors of PEP 484 can clarify here what should NoReturn do when used in generators? |
Beta Was this translation helpful? Give feedback.
-
How to type annotate never ending generators?
My current code:
Beta Was this translation helpful? Give feedback.
All reactions