GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-148829: Implement PEP 661 by JelleZijlstra · Pull Request #148831 · python/cpython

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented Apr 21, 2026 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Replaces JelleZijlstra#4. See python/steering-council#258.

  • Issue: Implement PEP 661 Sentinel Values #148829

📚 Documentation preview 📚: https://cpython-previews--148831.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JelleZijlstra and others added 11 commits April 16, 2026 20:45
@JelleZijlstra
Initial implementation of PEP 661 v2 (sentinels)
559e527
@JelleZijlstra @Viicos
Update Doc/library/functions.rst
ededfb7
Co-authored-by: Victorien <[email protected]>
@JelleZijlstra @Viicos
Update Doc/library/functions.rst
39f364c
Co-authored-by: Victorien <[email protected]>
@JelleZijlstra
gc, name
0adf314
@JelleZijlstra
C API
e4a106a
@JelleZijlstra
not needed
e5b8789
@JelleZijlstra
use it for NoExtraItems
bdcb400
@JelleZijlstra
tweaks
cc4545c
@JelleZijlstra
fix warning?
be58215
@JelleZijlstra
blurb
91de05b
@JelleZijlstra
attribute
4a970a6
@JelleZijlstra
JelleZijlstra requested review from a team, AA-Turner, AlexWaygood, ZeroIntensity, emmatyping, ericsnowcurrently and erlend-aasland as code owners April 21, 2026 13:59
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 21, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 21, 2026
Implement PEP 661 Sentinel Values #148829
Closed
@JelleZijlstra JelleZijlstra added the DO-NOT-MERGE label Apr 21, 2026
@JelleZijlstra JelleZijlstra mentioned this pull request Apr 21, 2026
PEP 661 -- Sentinel Values python/steering-council#258
Closed
5 tasks done
@johnslavik
johnslavik self-requested a review April 22, 2026 09:44
eendebakpt
eendebakpt reviewed Apr 22, 2026
View reviewed changes
Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/typing.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

eendebakpt
eendebakpt reviewed Apr 22, 2026
View reviewed changes
Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

eendebakpt
eendebakpt reviewed Apr 22, 2026
View reviewed changes
Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

ZeroIntensity
ZeroIntensity reviewed Apr 22, 2026
View reviewed changes
Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra
refactors
9cfd101
eendebakpt
eendebakpt reviewed Apr 22, 2026
View reviewed changes
Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra @eendebakpt
Update Objects/sentinelobject.c
a851235
Co-authored-by: Pieter Eendebak <[email protected]>
@JelleZijlstra JelleZijlstra added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 24, 2026
@bedevere-bot

bedevere-bot commented Apr 24, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit 53a84b6 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148831%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 24, 2026
ZeroIntensity
ZeroIntensity approved these changes Apr 24, 2026
View reviewed changes

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The C code and the corresponding documentation look good to me. I didn't look very closely at the tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Apr 24, 2026
sunmy2019
sunmy2019 reviewed Apr 24, 2026
View reviewed changes
Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

sunmy2019
sunmy2019 approved these changes Apr 24, 2026
View reviewed changes

@sunmy2019 sunmy2019 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
sunmy2019
sunmy2019 reviewed Apr 24, 2026
View reviewed changes

@sunmy2019 sunmy2019 left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify the pickle document. So that people will see X = sentinel("Y") is not picklable.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/c-api/sentinel.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/functions.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra

JelleZijlstra commented Apr 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Buildbot run: A few failures look unrelated

In file included from ./Include/internal/pycore_backoff.h:12,
                 from ./Include/internal/pycore_code.h:11,
                 from ./Include/internal/pycore_call.h:11,
                 from ./Modules/_ctypes/_ctypes.c:109:
./Modules/_ctypes/_ctypes.c: In function ‘set_stginfo_ffi_type_pointer’:
./Modules/_ctypes/_ctypes.c:2234:40: error: ‘FFI_TYPE_COMPLEX’ undeclared (first use in this function); did you mean ‘FFI_TYPE_DOUBLE’?
         assert(fmt->pffi_type->type == FFI_TYPE_COMPLEX);
                                        ^~~~~~~~~~~~~~~~
./Modules/_ctypes/_ctypes.c:2234:40: note: each undeclared identifier is reported only once for each function it appears in

But I also see

Traceback (most recent call last):
  File "/home/ubuntu/buildarea/pull_request.stan-aarch64-ubuntu.oddballs/build/Lib/test/pickletester.py", line 3254, in test_builtin_types
    s = self.dumps(t, proto)
  File "/home/ubuntu/buildarea/pull_request.stan-aarch64-ubuntu.oddballs/build/Lib/test/test_xpickle.py", line 190, in dumps
    return self.send_to_worker(python, data)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/pull_request.stan-aarch64-ubuntu.oddballs/build/Lib/test/test_xpickle.py", line 172, in send_to_worker
    raise exception
AttributeError: Can't get attribute 'sentinel' on <module 'builtins' (built-in)>

https://buildbot.python.org/#/builders/1865/builds/54

Which is a bit mysterious, is this looking at the builtins of another build?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sunmy2019

sunmy2019 commented Apr 24, 2026

Copy link
Copy Markdown
Member

Which is a bit mysterious, is this looking at the builtins of another build?

Yes. We need to patch this test. It tests pickle compatiblity acrosses python versions.

./python -m test test_xpickle -m test_builtin_types -u xpickle
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sunmy2019

sunmy2019 commented Apr 24, 2026

Copy link
Copy Markdown
Member
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 6366f12257..c2018c9785 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -3244,6 +3244,7 @@ def test_builtin_types(self):
             'BuiltinImporter': (3, 3),
             'str': (3, 4),  # not interoperable with Python < 3.4
             'frozendict': (3, 15),
+            'sentinel': (3, 15),
         }
         for t in builtins.__dict__.values():
             if isinstance(t, type) and not issubclass(t, BaseException):
JelleZijlstra and hugovk reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sunmy2019

sunmy2019 commented Apr 24, 2026

Copy link
Copy Markdown
Member

Buildbot run: A few failures look unrelated

I opened #148967 to track it.

JelleZijlstra reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed Apr 24, 2026
View reviewed changes
Comment thread Doc/c-api/sentinel.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/functions.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Include/sentinelobject.h Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Makefile.pre.in Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Makefile.pre.in Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/object.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Objects/sentinelobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra added 2 commits April 24, 2026 19:27
@JelleZijlstra
Merge remote-tracking branch 'upstream/main' into pep661
396356e
@JelleZijlstra
feedback
bfa98a1
@JelleZijlstra

JelleZijlstra commented Apr 25, 2026

Copy link
Copy Markdown
Member Author

Thanks for the feedback! Pushed a new version.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra added 2 commits April 24, 2026 23:00
@JelleZijlstra
add assert
465061a
@JelleZijlstra
another one
70c04a2
picnixz
picnixz reviewed Apr 25, 2026
View reviewed changes
Comment thread Lib/test/test_capi/test_object.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/functions.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_builtin.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_builtin.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

sunmy2019
sunmy2019 reviewed Apr 25, 2026
View reviewed changes
Comment thread Doc/library/functions.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra
more tweaks
7c276c5
@JelleZijlstra JelleZijlstra added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 27, 2026
@bedevere-bot

bedevere-bot commented Apr 27, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit 7c276c5 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F148831%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 27, 2026
@JelleZijlstra

JelleZijlstra commented Apr 28, 2026

Copy link
Copy Markdown
Member Author

Buildbot failures seem to be just the FFI_TYPE_COMPLEX thing on RHEL8.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra
JelleZijlstra merged commit 29a92ab into python:main Apr 28, 2026
107 of 117 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 28, 2026
@NekoAsakura NekoAsakura mentioned this pull request Apr 29, 2026
gh-148874: add flag to CALL to skip periodic check in with #149019
Closed
@vstinner

vstinner commented Apr 30, 2026

Copy link
Copy Markdown
Member

The Include/sentinelobject.h header file should be moved to Include/cpython/ since its C API is excluded from the limited C API. I created PR gh-149186 to move the header file.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@eendebakpt eendebakpt eendebakpt left review comments
@hugovk hugovk hugovk left review comments
@picnixz picnixz picnixz left review comments
@ZeroIntensity ZeroIntensity ZeroIntensity approved these changes
@sunmy2019 sunmy2019 sunmy2019 approved these changes
@AlexWaygood AlexWaygood Awaiting requested review from AlexWaygood AlexWaygood is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner
@johnslavik johnslavik Awaiting requested review from johnslavik

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@JelleZijlstra @bedevere-bot @sunmy2019 @vstinner @eendebakpt @hugovk @picnixz @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.