Skip to content

Commit b231186

Browse files
Deploy preview for PR 1226 🛫
1 parent ef43d5e commit b231186

584 files changed

Lines changed: 652 additions & 623 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pr-preview/pr-1226/_sources/howto/free-threading-extensions.rst.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,9 @@ C API extensions need to be built specifically for the free-threaded build.
395395
The wheels, shared libraries, and binaries are indicated by a ``t`` suffix.
396396

397397
* `pypa/manylinux <https://github.com/pypa/manylinux>`_ supports the
398-
free-threaded build, with the ``t`` suffix, such as ``python3.13t``.
399-
* `pypa/cibuildwheel <https://github.com/pypa/cibuildwheel>`_ supports the
400-
free-threaded build on Python 3.13 and 3.14. On Python 3.14, free-threaded
401-
wheels will be built by default. On Python 3.13, you will need to set
402-
`CIBW_ENABLE to cpython-freethreading <https://cibuildwheel.pypa.io/en/stable/options/#enable>`_.
398+
free-threaded build, with the ``t`` suffix, such as ``python3.14t``.
399+
* `pypa/cibuildwheel <https://github.com/pypa/cibuildwheel>`_ supports
400+
building wheels for the free-threaded build of Python 3.14 and newer.
403401

404402
Limited C API and Stable ABI
405403
............................

pr-preview/pr-1226/_sources/library/re.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,7 @@ successive matches::
18831883

18841884
class Token(NamedTuple):
18851885
type: str
1886-
value: str
1886+
value: int | float | str
18871887
line: int
18881888
column: int
18891889

pr-preview/pr-1226/_sources/library/typing.rst.txt

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,8 @@ These can be used as types in annotations. They all support subscription using
11741174
or transforms parameters of another
11751175
callable. Usage is in the form
11761176
``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``. ``Concatenate``
1177-
is currently only valid when used as the first argument to a :ref:`Callable <annotating-callables>`.
1177+
is valid when used in :ref:`Callable <annotating-callables>` type hints
1178+
and when instantiating user-defined generic classes with :class:`ParamSpec` parameters.
11781179
The last parameter to ``Concatenate`` must be a :class:`ParamSpec` or
11791180
ellipsis (``...``).
11801181

@@ -3345,13 +3346,13 @@ Functions and decorators
33453346
Introspection helpers
33463347
---------------------
33473348

3348-
.. function:: get_type_hints(obj, globalns=None, localns=None, include_extras=False)
3349+
.. function:: get_type_hints(obj, globalns=None, localns=None, include_extras=False, *, format=Format.VALUE)
33493350

33503351
Return a dictionary containing type hints for a function, method, module,
33513352
class object, or other callable object.
33523353

3353-
This is often the same as ``obj.__annotations__``, but this function makes
3354-
the following changes to the annotations dictionary:
3354+
This is often the same as :func:`annotationlib.get_annotations`, but this
3355+
function makes the following changes to the annotations dictionary:
33553356

33563357
* Forward references encoded as string literals or :class:`ForwardRef`
33573358
objects are handled by evaluating them in *globalns*, *localns*, and
@@ -3365,29 +3366,28 @@ Introspection helpers
33653366
annotations from ``C``'s base classes with those on ``C`` directly. This
33663367
is done by traversing :attr:`C.__mro__ <type.__mro__>` and iteratively
33673368
combining
3368-
``__annotations__`` dictionaries. Annotations on classes appearing
3369-
earlier in the :term:`method resolution order` always take precedence over
3370-
annotations on classes appearing later in the method resolution order.
3369+
:term:`annotations <variable annotation>` of each base class. Annotations
3370+
on classes appearing earlier in the :term:`method resolution order` always
3371+
take precedence over annotations on classes appearing later in the method
3372+
resolution order.
33713373
* The function recursively replaces all occurrences of
33723374
``Annotated[T, ...]``, ``Required[T]``, ``NotRequired[T]``, and ``ReadOnly[T]``
33733375
with ``T``, unless *include_extras* is set to ``True`` (see
33743376
:class:`Annotated` for more information).
33753377

3376-
See also :func:`annotationlib.get_annotations`, a lower-level function that
3377-
returns annotations more directly.
3378-
33793378
.. caution::
33803379

33813380
This function may execute arbitrary code contained in annotations.
33823381
See :ref:`annotationlib-security` for more information.
33833382

33843383
.. note::
33853384

3386-
If any forward references in the annotations of *obj* are not resolvable
3387-
or are not valid Python code, this function will raise an exception
3388-
such as :exc:`NameError`. For example, this can happen with imported
3389-
:ref:`type aliases <type-aliases>` that include forward references,
3390-
or with names imported under :data:`if TYPE_CHECKING <TYPE_CHECKING>`.
3385+
If :attr:`Format.VALUE <annotationlib.Format.VALUE>` is used and any
3386+
forward references in the annotations of *obj* are not resolvable, a
3387+
:exc:`NameError` exception is raised. For example, this can happen
3388+
with names imported under :data:`if TYPE_CHECKING <TYPE_CHECKING>`.
3389+
More generally, any kind of exception can be raised if an annotation
3390+
contains invalid Python code.
33913391

33923392
.. note::
33933393

@@ -3405,6 +3405,10 @@ Introspection helpers
34053405
if a default value equal to ``None`` was set.
34063406
Now the annotation is returned unchanged.
34073407

3408+
.. versionchanged:: 3.14
3409+
Added the ``format`` parameter. See the documentation on
3410+
:func:`annotationlib.get_annotations` for more information.
3411+
34083412
.. versionchanged:: 3.14
34093413
Calling :func:`get_type_hints` on instances is no longer supported.
34103414
Some instances were accepted in earlier versions as an undocumented

pr-preview/pr-1226/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ <h3>導航</h3>
356356
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
357357
<br>
358358
<br>
359-
最後更新於 4月 23, 2026 (00:36 UTC)。
359+
最後更新於 4月 24, 2026 (00:35 UTC)。
360360

361361
<a href="/bugs.html">發現 bug</a>
362362

pr-preview/pr-1226/bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 4月 23, 2026 (00:36 UTC)。
396+
最後更新於 4月 24, 2026 (00:35 UTC)。
397397

398398
<a href="/bugs.html">發現 bug</a>
399399

pr-preview/pr-1226/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>導航</h3>
365365
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
366366
<br>
367367
<br>
368-
最後更新於 4月 23, 2026 (00:36 UTC)。
368+
最後更新於 4月 24, 2026 (00:35 UTC)。
369369

370370
<a href="/bugs.html">發現 bug</a>
371371

pr-preview/pr-1226/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ <h3>導航</h3>
577577
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
578578
<br>
579579
<br>
580-
最後更新於 4月 23, 2026 (00:36 UTC)。
580+
最後更新於 4月 24, 2026 (00:35 UTC)。
581581

582582
<a href="/bugs.html">發現 bug</a>
583583

pr-preview/pr-1226/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>導航</h3>
514514
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
515515
<br>
516516
<br>
517-
最後更新於 4月 23, 2026 (00:36 UTC)。
517+
最後更新於 4月 24, 2026 (00:35 UTC)。
518518

519519
<a href="/bugs.html">發現 bug</a>
520520

pr-preview/pr-1226/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ <h3>導航</h3>
996996
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
997997
<br>
998998
<br>
999-
最後更新於 4月 23, 2026 (00:36 UTC)。
999+
最後更新於 4月 24, 2026 (00:35 UTC)。
10001000

10011001
<a href="/bugs.html">發現 bug</a>
10021002

pr-preview/pr-1226/c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>導航</h3>
376376
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
377377
<br>
378378
<br>
379-
最後更新於 4月 23, 2026 (00:36 UTC)。
379+
最後更新於 4月 24, 2026 (00:35 UTC)。
380380

381381
<a href="/bugs.html">發現 bug</a>
382382

0 commit comments

Comments
 (0)