[issue46475] Document use of NoReturn as a bottom type

2022-01-22 Thread Alex Waygood
Alex Waygood added the comment: I also agree that documenting this is a great idea. It's already been adopted by large swathes of the typing community for use in this context. The value of having NoReturn act as a "bottom type" is evident. Time to make it official, in my opinion.

[issue46475] Document use of NoReturn as a bottom type

2022-01-22 Thread Nikita Sobolev
Nikita Sobolev added the comment: I agree. Plus, I cannot refrain from saying that it is generally quite hard to teach what "NoReturn" is. I start by explaining what bottom type and `void` is and then just say that in Python it is called `NoReturn`. I remember that there was a discussion

[issue46475] Document use of NoReturn as a bottom type

2022-01-22 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- components: +Library (Lib) versions: +Python 3.10, Python 3.11, Python 3.9 ___ Python tracker ___ ___

[issue46475] Document use of NoReturn as a bottom type

2022-01-22 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : At the moment, https://docs.python.org/3.10/library/typing.html#typing.NoReturn simply says: Special type indicating that a function never returns. In practice, type checkers accept NoReturn as a bottom type in other positions too. We should document