| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Documentation build overview20 files changed · ± 20 modified ± Modified |
Sorry, something went wrong.
|
I set the skipNews tag since we're still pre-release, but OTOH, we're post-beta1, so we might still want to add a news entry. Should I add one? I was also mildly surprised to find the tests in object.c. By name, that seems quite generic for tests that belong to a specific builtin type. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Ah, sorry I forgot to follow up on this. I'm OK with the change and we should be able to do it in the beta phase, but we will need a NEWS entry since we already made a (beta) release with the old logic. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Return true if *o* is a :class:`sentinel` object or a subtype. | ||
| The :class:`sentinel` type does not currently allow subclasses, | ||
| so this check is exact. | ||
| Future Python versions may choose to allow subtyping. |
There was a problem hiding this comment.
Can you add "This function always succeeds." to both functions?
Sorry, something went wrong.
|
GH-149766 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
Merged. Thanks @scoder for your contribution! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
As suggested in https://discuss.python.org/t/pep-661-sentinel-values/9126/343, this PR adds a PySentinel_CheckExact() C macro and makes PySentinel_Check() an alias, which can change if/when we allow subtypes in the future.
The discussion seems to suggest that subtyping will be valuable at some point. Adding both C macros now allows to write concise code on user side that (hopefully) requires less changes later.
I chose to make PySentinel_Check() an alias of PySentinel_CheckExact() and not the other way round because the current C macro actually does an exact check, so its correct name is PySentinel_CheckExact().