Skip to content

gh-162069: Add optional doc parameter to sentinel - #162070

Open
tmke8 wants to merge 1 commit into
python:mainfrom
tmke8:gh-162069-sentinel-doc
Open

tmke8 wants to merge 1 commit into
python:mainfrom
tmke8:gh-162069-sentinel-doc

Conversation

@tmke8

@tmke8 tmke8 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Sentinel objects can now be given a docstring with sentinel(name, doc=...). The __doc__ attribute of a sentinel object remains read-only.

>>> MISSING = sentinel("MISSING", doc="No value was provided.")
>>> MISSING.__doc__
'No value was provided.'

Sentinel objects can now be given a docstring with
`sentinel(name, doc=...)`. The `__doc__` attribute of a sentinel object
remains read-only.
@tmke8
tmke8 requested a review from AA-Turner as a code owner November 15, 2026 23:04
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Nov 15, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35913237 | 📁 Comparing ece1b68 against main (d8bc666)

  🔍 Preview build  

3 files changed
± builtins/functions.html
± whatsnew/3.16.html
± whatsnew/changelog.html

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

Labels

awaiting review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant