Skip to content

Commit 224f8d5

Browse files
Post-release followups for 3.16.0rc1 (#767)
* Post-release followups for 3.16.0rc1 * Update doc/index.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> --------- Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent 777de3e commit 224f8d5

4 files changed

Lines changed: 48 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- Fix setting of `__required_keys__` and `__optional_keys__` when inheriting
77
keys with the same name.
88
- Add support for `AsyncIterator`, `io.Reader`, `io.Writer` and `os.PathLike` protocols
9-
as bases for other protocls.
9+
as bases for other protocols.
1010
- Fix incorrect behaviour on Python 3.9 and Python 3.10 that meant that
1111
calling `isinstance` with `typing_extensions.Concatenate[...]` or
1212
`typing_extensions.Unpack[...]` as the first argument could have a different
@@ -20,7 +20,22 @@
2020
Python 3.9. The `typing` implementation has always raised an error, and the
2121
`typing_extensions` implementation has raised an error on Python 3.10+ since
2222
`typing_extensions` v4.6.0. Patch by Brian Schubert.
23-
- Add `bound` and variance parameters to `TypeVarTuple`.
23+
- Add the `bound`, `covariant`, `contravariant`, and `infer_variance` parameters
24+
to `TypeVarTuple`.
25+
- Officially support the `bound`, `covariant`, `contravariant` and `infer_variance`
26+
parameters to `ParamSpec`. Improve the validation of these parameters at runtime.
27+
- Rename `typing_extensions.Sentinel` to `typing_extensions.sentinel`, following the
28+
name that has been adopted for `builtins.sentinel` on Python 3.15.
29+
`typing_extensions.Sentinel` is retained as a soft-deprecated alias for backwards
30+
compatibility.
31+
- Add support for pickling sentinels.
32+
- Sentinels now preserve their identity when copied or deep-copied.
33+
- Deprecate passing `name` as a keyword argument or `repr` as a positional argument
34+
to the `sentinel` constructor.
35+
- The default repr of a sentinel `X = sentinel("X")` is now `X` rather than `<X>`.
36+
- Deprecate arbitrary attribute assignments to sentinels.
37+
- Deprecate subclassing sentinels.
38+
- Add support for Python 3.15.
2439

2540
# Release 4.15.0 (August 25, 2025)
2641

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ pipx run pre-commit run -a
8888

8989
- Ensure that GitHub Actions reports no errors.
9090

91+
- Check that `CHANGELOG.md` accurately reflects all important changes committed to `main` since the previous release.
92+
9193
- Update the version number in `typing_extensions/pyproject.toml` and in
9294
`typing_extensions/CHANGELOG.md`.
9395

doc/index.rst

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ Python version in which each feature was added to :py:mod:`typing` and the
267267
- 3.11
268268
- 4.0.0
269269
- :pep:`673`
270-
* - :class:`Sentinel`
271-
- 3.14
272-
- 4.14.0
270+
* - :class:`sentinel`
271+
- 3.15
272+
- 4.14.0 (originally under the name `Sentinel`)
273273
- :pep:`661`
274274
* - :class:`TypeAliasType`
275275
- 3.12
@@ -453,13 +453,13 @@ Special typing primitives
453453

454454
.. versionadded:: 4.0.0
455455

456-
.. class:: ParamSpec(name, *, default=NoDefault)
456+
.. class:: ParamSpec(name, *, bound=None, covariant=False,
457+
contravariant=False, infer_variance=False, default=NoDefault)
457458

458459
See :py:class:`typing.ParamSpec` and :pep:`612`. In ``typing`` since 3.10.
459460

460461
The ``typing_extensions`` version adds support for the
461-
``default=`` argument from :pep:`696`, and for the ``infer_variance=``,
462-
``covariant=`` and ``contravariant=`` arguments that were added in Python 3.15.
462+
``default=`` argument from :pep:`696`.
463463

464464
On older Python versions, ``typing_extensions.ParamSpec`` may not work
465465
correctly with introspection tools like :func:`get_args` and
@@ -495,7 +495,8 @@ Special typing primitives
495495

496496
.. versionchanged:: 4.16.0
497497

498-
The ``infer_variance``, ``covariant``, and ``contravariant`` arguments are now supported.
498+
The ``infer_variance``, ``covariant``, and ``contravariant`` arguments are now
499+
officially supported and their validation is improved.
499500

500501
.. class:: ParamSpecArgs
501502
ParamSpecKwargs
@@ -719,13 +720,14 @@ Special typing primitives
719720
TypeVars now have a ``has_default()`` method, for compatibility
720721
with :py:class:`typing.TypeVar` on Python 3.13+.
721722

722-
.. class:: TypeVarTuple(name, *, default=NoDefault)
723+
.. class:: TypeVarTuple(name, *, bound=None, covariant=False,
724+
contravariant=False, infer_variance=False, default=NoDefault)
723725

724726
See :py:class:`typing.TypeVarTuple` and :pep:`646`. In ``typing`` since 3.11.
725727

726-
The ``typing_extensions`` version adds support for the
727-
``default=`` argument from :pep:`696`, and for the ``infer_variance=``,
728-
``covariant=`` and ``contravariant=`` arguments that were added in Python 3.15.
728+
The ``typing_extensions`` version adds support for the ``default=`` argument
729+
from :pep:`696`, and for the ``bound=``, ``infer_variance=``, ``covariant=``
730+
and ``contravariant=`` arguments that were added in Python 3.15.
729731

730732
.. versionadded:: 4.1.0
731733

@@ -759,7 +761,8 @@ Special typing primitives
759761

760762
.. versionchanged:: 4.16.0
761763

762-
The ``infer_variance``, ``covariant``, and ``contravariant`` arguments are now supported.
764+
The ``bound``, ``infer_variance``, ``covariant``, and ``contravariant``
765+
arguments are now supported.
763766

764767
.. data:: Unpack
765768

@@ -1288,14 +1291,18 @@ Sentinel objects
12881291
.. versionchanged:: 4.16.0
12891292

12901293
The implementation of this class has been updated to conform to
1291-
the accepted version of :pep:`661`.
1292-
1293-
Now supports pickle and will be reduced as a singleton.
1294-
Renamed from `Sentinel` to `sentinel`, `Sentinel` is deprecated.
1295-
Automatic `repr` string no longer has angle brackets.
1296-
`repr` as a positional argument is deprecated.
1297-
`name` as a keyword is deprecated.
1298-
Subclassing and attribute assignment are deprecated.
1294+
the accepted version of :pep:`661`:
1295+
1296+
- Sentinels can now be pickled. They are reduced as singletons, which
1297+
means that they also preserve their identity when copied or deep-copied.
1298+
- `Sentinel` has been renamed to `sentinel`. `Sentinel` is retained as a
1299+
soft-deprecated alias, for backwards compatibility.
1300+
- The default repr of a sentinel `X = sentinel("X")` is now `X`, rather
1301+
than `<X>`.
1302+
- Passing `repr` as a positional argument to the constructor is deprecated.
1303+
- Passing `name` as a keyword argument to the constructor is deprecated.
1304+
- Subclassing `sentinel` is deprecated.
1305+
- Assigning arbitrary attributes to a sentinel is deprecated.
12991306

13001307

13011308
Pure aliases

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi"
66
# Project metadata
77
[project]
88
name = "typing_extensions"
9-
version = "4.16.0rc1"
9+
version = "4.16.0rc1.dev"
1010
description = "Backported and Experimental Type Hints for Python 3.9+"
1111
readme = "README.md"
1212
requires-python = ">=3.9"
@@ -40,6 +40,7 @@ classifiers = [
4040
"Programming Language :: Python :: 3.12",
4141
"Programming Language :: Python :: 3.13",
4242
"Programming Language :: Python :: 3.14",
43+
"Programming Language :: Python :: 3.15",
4344
"Topic :: Software Development",
4445
]
4546

0 commit comments

Comments
 (0)