René's URL Explorer Experiment


Title: Add sentinels (PEP 661) to the spec by JelleZijlstra · Pull Request #2277 · python/typing · GitHub

Open Graph Title: Add sentinels (PEP 661) to the spec by JelleZijlstra · Pull Request #2277 · python/typing

X Title: Add sentinels (PEP 661) to the spec by JelleZijlstra · Pull Request #2277 · python/typing

Description: PEP-661 was accepted and implemented for Python 3.15. The main typing innovation is that sentinel objects are usable directly in type annotations. In this proposed text I chose to drop the requirement that the name of the sentinel variable must match the name of the sentinel itself. When I converted sentinels to the new class in CPython itself (https://github.com/python/cpython/pull/149084/changes#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777), I encountered some that had a pre-existing repr with special characters in it, and it seemed best to leave it alone (UNNAMED_SECTION = sentinel("")). And in the PEP discussion, there were questions about sentinels defined in classes: to make those picklable, you'd have to prefix the sentinel name with the class name (https://discuss.python.org/t/pep-661-sentinel-values/9126/345). I feel there isn't a strong typing reason for requiring that the two names must match. It may be a good code quality rule to require that the two names match, but type checkers should be able to support sentinels in annotations fine even if they don't match. No type checker supports the PEP fully yet, though pyright apparently has experimental support. I validated the conformance tests in this PR by using pycroscope, which does support it but currently enforces the same-name rule.

Open Graph Description: PEP-661 was accepted and implemented for Python 3.15. The main typing innovation is that sentinel objects are usable directly in type annotations. In this proposed text I chose to drop the requirem...

X Description: PEP-661 was accepted and implemented for Python 3.15. The main typing innovation is that sentinel objects are usable directly in type annotations. In this proposed text I chose to drop the requirem...

Opengraph URL: https://github.com/python/typing/pull/2277

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f8c19556-e529-8b8a-1244-45516a601dbe
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDE60:291B58:43F7280:55E6D47:6B026954
html-safe-nonced6e4cd56fa9865b2439085df1b1755e4e09a6819fd4cabc0fe4a4301a1cb875b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTYwOjI5MUI1ODo0M0Y3MjgwOjU1RTZENDc6NkIwMjY5NTQiLCJ2aXNpdG9yX2lkIjoiNzA5NDAxMDg4NDg5NjQ4MzY2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8fd22bef6a1ad045123a4e5d7118ba7e5554d47ca10453738b8eff1e15de4275
hovercard-subject-tagpull_request:3612797331
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/typing/pull/2277/files
twitter:imagehttps://avatars.githubusercontent.com/u/906600?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/906600?s=400&v=4
og:image:altPEP-661 was accepted and implemented for Python 3.15. The main typing innovation is that sentinel objects are usable directly in type annotations. In this proposed text I chose to drop the requirem...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/typing git https://github.com/python/typing.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id24604008
octolytics-dimension-repository_nwopython/typing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24604008
octolytics-dimension-repository_network_root_nwopython/typing
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/typing/pull/2277/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fpull%2F2277%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fpull%2F2277%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Ftyping
Reloadhttps://github.com/python/typing/pull/2277/files
Reloadhttps://github.com/python/typing/pull/2277/files
Reloadhttps://github.com/python/typing/pull/2277/files
pythonhttps://github.com/python
typinghttps://github.com/python/typing
Codehttps://github.com/python/typing
Issues206 (206)https://github.com/python/typing/issues
Pull requests27 (27)https://github.com/python/typing/pulls
Discussionshttps://github.com/python/typing/discussions
Actionshttps://github.com/python/typing/actions
Security and qualityhttps://github.com/python/typing/security
Insightshttps://github.com/python/typing/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Ftyping%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Ftyping%2Fissues%2Fnew%2Fchoose
JelleZijlstrahttps://github.com/JelleZijlstra
python:mainhttps://github.com/python/typing/tree/main
JelleZijlstra:sentinelshttps://github.com/JelleZijlstra/typing/tree/sentinels
Conversation 18 https://github.com/python/typing/pull/2277
Commits 7 https://github.com/python/typing/pull/2277/commits
Checks 3 https://github.com/python/typing/pull/2277/checks
Files changed https://github.com/python/typing/pull/2277/files
Please reload this pagehttps://github.com/python/typing/pull/2277/files
Add sentinels (PEP 661) to the spec https://github.com/python/typing/pull/2277/files#top
Show all changes 7 commits https://github.com/python/typing/pull/2277/files
d9961b2 Add sentinels (PEP 661) to the spec JelleZijlstra May 1, 2026 https://github.com/python/typing/pull/2277/commits/d9961b268ef676ae20ddb239b4db6dcb042f1c9c
de6d9ea . JelleZijlstra May 1, 2026 https://github.com/python/typing/pull/2277/commits/de6d9eabaa5cc288f0ded5710e569669ad9415b5
19e4152 Merge remote-tracking branch 'upstream/main' into sentinels JelleZijlstra May 2, 2026 https://github.com/python/typing/pull/2277/commits/19e4152a4a9602672aa4d3a93fc7e260d32a398a
e6dd6e3 update JelleZijlstra May 2, 2026 https://github.com/python/typing/pull/2277/commits/e6dd6e3b51f1133fd464c3e63a127b4c57b5b0b2
84d6fd8 add file JelleZijlstra May 2, 2026 https://github.com/python/typing/pull/2277/commits/84d6fd8fd889fabc69562275a9807203d733bfab
36a2158 add JelleZijlstra May 2, 2026 https://github.com/python/typing/pull/2277/commits/36a2158213e9198493b3866b88579e5baf42bdfd
9e7b570 Merge remote-tracking branch 'upstream/main' into codex/pr-2277-merge… JelleZijlstra Aug 7, 2026 https://github.com/python/typing/pull/2277/commits/9e7b570ddea26be7ed51eef09700d4b868dde765
Clear filters https://github.com/python/typing/pull/2277/files
Please reload this pagehttps://github.com/python/typing/pull/2277/files
Please reload this pagehttps://github.com/python/typing/pull/2277/files
specialtypes_sentinels.toml https://github.com/python/typing/pull/2277/files#diff-06a9a6b60ffa25784e3f9eb0d19ec06ad77ef2f4e6373d6fd63cec2ce8c6179b
specialtypes_sentinels.toml https://github.com/python/typing/pull/2277/files#diff-cef735efee9388f2a01253589a4a50ca8cc517ce10922469cd1179b97f68ec7d
specialtypes_sentinels.toml https://github.com/python/typing/pull/2277/files#diff-a43fef498ee792912cd4c8556185b87cec27c7d27ffd31cf0bf3002650a6f4dc
specialtypes_sentinels.toml https://github.com/python/typing/pull/2277/files#diff-ab3dc525bd1f78d98471d87efd8fb1ce8236b7d477b6ed67c95dbb3d34aa2704
results.html https://github.com/python/typing/pull/2277/files#diff-1026e9a5ffcc2a9a0af3bc5b250ce31a9562dc874f49390536bb28e2e129c381
specialtypes_sentinels.toml https://github.com/python/typing/pull/2277/files#diff-2754d114e5b632ed783b7e3c55a1456b8cdea39a213608b05ea6bdb2a5c79653
specialtypes_sentinels.toml https://github.com/python/typing/pull/2277/files#diff-e04ce743726b8f59d19cbea0b6d3e4d6f4f7d24d7ffba06ce586abcf20fb556f
specialtypes_sentinels.py https://github.com/python/typing/pull/2277/files#diff-69a3e1ca4988c354da27135f7475130290c169a6e3056e910cfa22b31d986ac0
annotations.rst https://github.com/python/typing/pull/2277/files#diff-184b677a01f925aa7d9a29fabc8c946f2d99da37850f89210ad5a2ff33fa52cf
special-types.rst https://github.com/python/typing/pull/2277/files#diff-a4c6e6971a9fffe88effa082aba7021df4a18a0fc5f8e2d03b866073933291b7
conformance/results/mypy/specialtypes_sentinels.tomlhttps://github.com/python/typing/pull/2277/files#diff-06a9a6b60ffa25784e3f9eb0d19ec06ad77ef2f4e6373d6fd63cec2ce8c6179b
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/conformance/results/mypy/specialtypes_sentinels.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
conformance/results/pycroscope/specialtypes_sentinels.tomlhttps://github.com/python/typing/pull/2277/files#diff-cef735efee9388f2a01253589a4a50ca8cc517ce10922469cd1179b97f68ec7d
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/conformance/results/pycroscope/specialtypes_sentinels.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
conformance/results/pyrefly/specialtypes_sentinels.tomlhttps://github.com/python/typing/pull/2277/files#diff-a43fef498ee792912cd4c8556185b87cec27c7d27ffd31cf0bf3002650a6f4dc
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/conformance/results/pyrefly/specialtypes_sentinels.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
conformance/results/pyright/specialtypes_sentinels.tomlhttps://github.com/python/typing/pull/2277/files#diff-ab3dc525bd1f78d98471d87efd8fb1ce8236b7d477b6ed67c95dbb3d34aa2704
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/conformance/results/pyright/specialtypes_sentinels.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
conformance/results/results.htmlhttps://github.com/python/typing/pull/2277/files#diff-1026e9a5ffcc2a9a0af3bc5b250ce31a9562dc874f49390536bb28e2e129c381
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/conformance/results/results.html
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/typing/pull/2277/files
conformance/results/ty/specialtypes_sentinels.tomlhttps://github.com/python/typing/pull/2277/files#diff-2754d114e5b632ed783b7e3c55a1456b8cdea39a213608b05ea6bdb2a5c79653
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/conformance/results/ty/specialtypes_sentinels.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
conformance/results/zuban/specialtypes_sentinels.tomlhttps://github.com/python/typing/pull/2277/files#diff-e04ce743726b8f59d19cbea0b6d3e4d6f4f7d24d7ffba06ce586abcf20fb556f
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/conformance/results/zuban/specialtypes_sentinels.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
conformance/tests/specialtypes_sentinels.pyhttps://github.com/python/typing/pull/2277/files#diff-69a3e1ca4988c354da27135f7475130290c169a6e3056e910cfa22b31d986ac0
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/conformance/tests/specialtypes_sentinels.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
Please reload this pagehttps://github.com/python/typing/pull/2277/files
carljmhttps://github.com/carljm
Jul 27, 2026https://github.com/python/typing/pull/2277/files#r3659573504
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
astral-sh/ty#4091https://github.com/astral-sh/ty/issues/4091
Please reload this pagehttps://github.com/python/typing/pull/2277/files
JelleZijlstrahttps://github.com/JelleZijlstra
Jul 27, 2026https://github.com/python/typing/pull/2277/files#r3661446846
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typing/pull/2277/files
carljmhttps://github.com/carljm
Jul 27, 2026https://github.com/python/typing/pull/2277/files#r3661486600
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typing/pull/2277/files
JelleZijlstrahttps://github.com/JelleZijlstra
Jul 27, 2026https://github.com/python/typing/pull/2277/files#r3661496775
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typing/pull/2277/files
carljmhttps://github.com/carljm
Jul 27, 2026https://github.com/python/typing/pull/2277/files#r3661632619
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typing/pull/2277/files
docs/spec/annotations.rsthttps://github.com/python/typing/pull/2277/files#diff-184b677a01f925aa7d9a29fabc8c946f2d99da37850f89210ad5a2ff33fa52cf
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/docs/spec/annotations.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
https://github.com/python/typing/pull/2277/files#diff-184b677a01f925aa7d9a29fabc8c946f2d99da37850f89210ad5a2ff33fa52cf
https://github.com/python/typing/pull/2277/files#diff-184b677a01f925aa7d9a29fabc8c946f2d99da37850f89210ad5a2ff33fa52cf
docs/spec/special-types.rsthttps://github.com/python/typing/pull/2277/files#diff-a4c6e6971a9fffe88effa082aba7021df4a18a0fc5f8e2d03b866073933291b7
View file https://github.com/JelleZijlstra/typing/blob/9e7b570ddea26be7ed51eef09700d4b868dde765/docs/spec/special-types.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/typing/pull/2277/{{ revealButtonHref }}
https://github.com/python/typing/pull/2277/files#diff-a4c6e6971a9fffe88effa082aba7021df4a18a0fc5f8e2d03b866073933291b7
cdce8phttps://github.com/cdce8p
May 1, 2026https://github.com/python/typing/pull/2277/files#r3174549380
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typing/pull/2277/files
carljmhttps://github.com/carljm
May 1, 2026https://github.com/python/typing/pull/2277/files#r3175044102
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typing/pull/2277/files
JelleZijlstrahttps://github.com/JelleZijlstra
May 2, 2026https://github.com/python/typing/pull/2277/files#r3176661367
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://github.com/pydantic/pydantic/blob/597fa692eaaa90132f683e88ca994f28e185463b/pydantic-core/python/pydantic_core/__init__.py#L148https://github.com/pydantic/pydantic/blob/597fa692eaaa90132f683e88ca994f28e185463b/pydantic-core/python/pydantic_core/__init__.py#L148
Please reload this pagehttps://github.com/python/typing/pull/2277/files
cdce8phttps://github.com/cdce8p
May 2, 2026https://github.com/python/typing/pull/2277/files#r3176924411
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://github.com/pydantic/pydantic/blob/597fa692eaaa90132f683e88ca994f28e185463b/pydantic-core/python/pydantic_core/__init__.py#L148https://github.com/pydantic/pydantic/blob/597fa692eaaa90132f683e88ca994f28e185463b/pydantic-core/python/pydantic_core/__init__.py#L148
Please reload this pagehttps://github.com/python/typing/pull/2277/files
JelleZijlstrahttps://github.com/JelleZijlstra
May 2, 2026https://github.com/python/typing/pull/2277/files#r3176935796
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typing/pull/2277/files
cdce8phttps://github.com/cdce8p
May 2, 2026https://github.com/python/typing/pull/2277/files#r3176949366
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/typing/pull/2277/files
Viicoshttps://github.com/Viicos
May 21, 2026https://github.com/python/typing/pull/2277/files#r3281207499
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
explicitly documenthttps://pydantic.dev/docs/validation/latest/concepts/experimental/#missing-sentinel
Please reload this pagehttps://github.com/python/typing/pull/2277/files
https://github.com/python/typing/pull/2277/files#diff-a4c6e6971a9fffe88effa082aba7021df4a18a0fc5f8e2d03b866073933291b7
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.