◐ Shell
clean mode source ↗

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

added 2 commits

April 30, 2026 21:22

cdce8p

davidhalter

davidhalter

This was referenced

May 10, 2026

sharkdp pushed a commit to astral-sh/ruff that referenced this pull request

May 13, 2026
## Summary

Add support for `typing_extensions.Sentinel` (PEP 661). Support for the
other variants (`builtins.sentinel`, `typing_extensions.sentinel`) can
be added later as stubs are updated.

See PEP 661 and python/typing#2277

## Test Plan

New tests added.

thejchap pushed a commit to thejchap/ruff that referenced this pull request

May 23, 2026
## Summary

Add support for `typing_extensions.Sentinel` (PEP 661). Support for the
other variants (`builtins.sentinel`, `typing_extensions.sentinel`) can
be added later as stubs are updated.

See PEP 661 and python/typing#2277

## Test Plan

New tests added.

hrolfurgylfa added a commit to hrolfurgylfa/pyrefly that referenced this pull request

Jun 2, 2026
This seems to be what is being decided in the python typing spec, see
the PR description: python/typing#2277

Although some typecheckers, like pyright, still have the old behaviour
recommended in the PEP of giving an error when a different name is
assigned.

hrolfurgylfa added a commit to hrolfurgylfa/pyrefly that referenced this pull request

Jun 4, 2026
This seems to be what is being decided in the python typing spec, see
the PR description: python/typing#2277

Although some typecheckers, like pyright, still have the old behaviour
recommended in the PEP of giving an error when a different name is
assigned.