Uh oh!
There was an error while loading. Please reload this page.
gh-116126: Implement PEP 696 - #116129
Conversation
JelleZijlstra
commented
Mar 1, 2024
This should be ready for review now, I'll take it out of draft once the tests pass. Notes:
|
pablogsal
commented
Mar 1, 2024
Will review this weekend |
JelleZijlstra
commented
Apr 10, 2024
@pablogsal have you had a chance to look at this? The grammar changes should be quite straightforward, so hopefully it's not complicated to review. I'll spend some time today trying to make it so the field is called "default" not "default_" in Python, because having "default_" in the Python-visible APIs would be ugly. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
AlexWaygood
left a comment
There was a problem hiding this comment.
I would say "is not the typing.NoDefault singleton" rather than "is not equal to typing.NoDefault", since we usually argue that an identity check is more idiomatic for singleton objects such as None, NotImplemented and Ellipsis
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| >>> T.__default__ is typing.NoDefault | ||
| True | ||
| >>> S = TypeVar("S", default=None) | ||
| >>> S.__default__ is None | ||
| True |
There was a problem hiding this comment.
| >>> T.__default__ is typing.NoDefault | |
| True | |
| >>> S = TypeVar("S", default=None) | |
| >>> S.__default__ isNone | |
| True | |
| >>> T.has_default() | |
| False | |
| >>> T.__default__ is typing.NoDefault | |
| True | |
| >>> S = TypeVar("S", default=None) | |
| >>> S.has_default() | |
| True | |
| >>> S.__default__ isNone | |
| True |
There was a problem hiding this comment.
I thought of that but it felt out of place in the docs for NoDefault, since the cases you added don't use NoDefault at all.
There was a problem hiding this comment.
Fair enough -- I thought it was quite nice to see together in one example how the two concepts interrelate, but I definitely don't feel strongly!
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
JelleZijlstra
commented
Apr 28, 2024
@ericsnowcurrently the C globals check is failing because this PR now adds a new static type and global singleton, |
ericsnowcurrently
commented
Apr 30, 2024
For now let's just whitelist the new singleton, as long as it is stateless and immortal. We can circle back later if the whitelist is a problem. |
bedevere-bot
commented
Apr 30, 2024
🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit 5f6fdfd 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
The previous logic would add the size of the pointer target to the pointer value, which might point to another pointer being used as a scope key. Now, we increment the value as an integer instead, which means it can never be a valid pointer.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
This implements both the grammar and compiler changes and changes to
typing.pybehavior (the latter copied from typing-extensions).