Skip to content

Initial implementation of PEP 661 v2 (sentinels)#4

Open
JelleZijlstra wants to merge 9 commits intomainfrom
pep661
Open

Initial implementation of PEP 661 v2 (sentinels)#4
JelleZijlstra wants to merge 9 commits intomainfrom
pep661

Conversation

@JelleZijlstra
Copy link
Copy Markdown
Owner

@JelleZijlstra JelleZijlstra commented Apr 17, 2026


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

@JelleZijlstra
Copy link
Copy Markdown
Owner Author

Open questions:

  • What about __bool__? Lots of discussion on Discourse, I don't care too much but don't want this to derail the feature. This draft implementation says sentinels are always truthy.
  • Should sentinels be weakrefable?
  • Should the sentinel class be subclassable? My inclination is no.
  • Should there be a C API like PySentinel_New? Probably.

Comment thread Objects/sentinelobject.c
Comment thread Objects/sentinelobject.c Outdated
Comment thread Doc/library/functions.rst Outdated
Comment thread Doc/library/functions.rst
Comment thread Doc/library/functions.rst Outdated
@Viicos
Copy link
Copy Markdown

Viicos commented Apr 17, 2026

Open questions:

Gave thoughts on python/peps#4923 (comment).

JelleZijlstra and others added 7 commits April 17, 2026 17:37
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Copy link
Copy Markdown

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

I only looked at the .rst file as my minimal knowledge of C won't help much here. There are a couple of double spaces in some of them, perhaps before merging quickly grep for " " in the diff to remove those :)

@JelleZijlstra
Copy link
Copy Markdown
Owner Author

Thanks for looking! I think the double spaces are mainly between sentences, that's very common in the docs. It doesn't affect rendering.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants