Skip to content

gh-149083: Document that dataclasses.MISSING and KW_ONLY are sentinels - #155919

Merged
hugovk merged 4 commits into
python:mainfrom
fregataa:docs-dataclasses-sentinel
Aug 17, 2026
Merged

gh-149083: Document that dataclasses.MISSING and KW_ONLY are sentinels#155919
hugovk merged 4 commits into
python:mainfrom
fregataa:docs-dataclasses-sentinel

Conversation

@fregataa

@fregataa fregataa commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

#149086 converted dataclasses.MISSING and dataclasses.KW_ONLY to instances of the builtin sentinel, but the dataclasses documentation was not updated to match.

This PR:

  • links the prose and both .. data:: entries to :class:sentinel;
  • adds .. versionchanged:: 3.15 notes to MISSING and KW_ONLY.

Documentation-only change, so no Misc/NEWS.d entry — please add the skip news label. Needs a backport to 3.15, where the change landed.

…ntinels

Link both to the sentinel builtin and note the 3.15 change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@fregataa
fregataa requested a review from ericvsmith as a code owner August 17, 2026 02:39
@python-cla-bot

python-cla-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

read-the-docs-community Bot commented Aug 17, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34095560 | 📁 Comparing 69cff04 against main (7a845ce)

  🔍 Preview build  

1 file changed
± library/dataclasses.html

@fregataa fregataa changed the title [3.15] gh-149083: Document that dataclasses.MISSING and KW_ONLY are sentinels gh-149083: Document that dataclasses.MISSING and KW_ONLY are sentinels Aug 17, 2026
@corona10 corona10 added needs backport to 3.15 pre-release feature fixes, bugs and security fixes sprint labels Aug 17, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Sprint Aug 17, 2026
@corona10

Copy link
Copy Markdown
Member

I think that @hugovk should take a deep look at whether the documentation is proper or not. And we also wait his approval for backport :)

fregataa and others added 2 commits August 17, 2026 12:02
The old repr is not stated, so "had a different repr" is not actionable,
and the sentinel docs already describe how a sentinel reprs itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread Doc/library/dataclasses.rst Outdated
.. data:: MISSING

A sentinel value signifying a missing default or default_factory.
A :class:`sentinel` object signifying a missing default or default_factory.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could also add the missing markup:

Suggested change
A :class:`sentinel` object signifying a missing default or default_factory.
A :class:`sentinel` object signifying a missing default or *default_factory*.

@fregataa fregataa Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I added the markup on the part. Is it okay to backport this markup?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, we can also backport that, and it's part of the automated backport: #155927

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Sprint Aug 17, 2026
@hugovk
hugovk enabled auto-merge (squash) August 17, 2026 03:47
@hugovk

hugovk commented Aug 17, 2026

Copy link
Copy Markdown
Member

Thanks!

@hugovk
hugovk merged commit e13c3d6 into python:main Aug 17, 2026
30 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Aug 17, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Sprint Aug 17, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @fregataa for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Aug 17, 2026

Copy link
Copy Markdown

GH-155927 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news sprint

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants