GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-46475: Add typing.Never and typing.assert_never by JelleZijlstra · Pull Request #30842 · python/cpython Conversation
|
|
Thanks @gvanrossum! I think I addressed all previous comments, so from my perspective this is ready. https://mail.python.org/archives/list/[email protected]/thread/CGIYKGMF6XLDX3F2JNRCCE7HC6K2XLZ2/ is the typing-sig thread. Nobody opposed it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Should I wait for the tests or are they hanging? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
They just started, I had to fix a merge conflict. It's going to conflict with the Self change too, which is why I pinged you on that one first. I think this is the easiest way forward:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I've got more...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| def int_or_str(arg: int | str) -> None: | ||
| match arg: | ||
| case int(): | ||
| print("It's an int") | ||
| case str(): | ||
| print("It's a str") | ||
| case _: | ||
| assert_never(arg) | ||
|
|
||
| If a type checker finds that a call to assert_never() is | ||
| reachable, it will emit an error. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This example is much better than the examples in the main doc. :-) And so is the sentence following the example.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That sentence is also in the docs for assert_never, but not Never. I'm pushing some changes to improve the Never docs according to your feedback.
Honestly I'm a bit confused about the relationship between the docstring and the RST docs. I end up copying from one to the other.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Usually the docstring is shorter, since it is often displayed by tools that have limited output space (it's really annoying to get a scroll bar in a tooltip in VS Code :-).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for your feedback! I pushed a round of docs changes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM — thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks for being patient with me.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you for the feedback! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
Backport of python/cpython#30842, with additional tests from @sobolevn's python/cpython#31222.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.