Skip to content
Merged
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,8 @@ Modules/_xxtestfuzz/ @ammaraskar
**/*templateobject* @lysnikolaou
**/*templatelib* @lysnikolaou
**/*tstring* @lysnikolaou

# Remote debugging
Python/remote_debug.h @pablogsal
Python/remote_debugging.c @pablogsal
Modules/_remote_debugging_module.c @pablogsal @ambv @1st1
14 changes: 13 additions & 1 deletion Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1228,10 +1228,22 @@ Special attributes
:attr:`__annotations__ attributes <object.__annotations__>`.

For best practices on working with :attr:`~object.__annotations__`,
please see :mod:`annotationlib`. Where possible, use
please see :mod:`annotationlib`. Use
:func:`annotationlib.get_annotations` instead of accessing this
attribute directly.

.. warning::

Accessing the :attr:`!__annotations__` attribute directly
on a class object may return annotations for the wrong class, specifically
in certain cases where the class, its base class, or a metaclass
is defined under ``from __future__ import annotations``.
See :pep:`749 <749#pep749-metaclasses>` for details.

This attribute does not exist on certain builtin classes. On
user-defined classes without ``__annotations__``, it is an
empty dictionary.

.. versionchanged:: 3.14
Annotations are now :ref:`lazily evaluated <lazy-evaluation>`.
See :pep:`649`.
Expand Down
11 changes: 10 additions & 1 deletion Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ deferred evaluation of annotations (:pep:`649`),
and a new type of interpreter that uses tail calls.

The library changes include the addition of a new :mod:`!annotationlib` module
for introspecting and wrapping annotations (:pep:`649`),
for introspecting and wrapping annotations (:pep:`749`),
a new :mod:`!compression.zstd` module for Zstandard support (:pep:`784`),
plus syntax highlighting in the REPL,
as well as the usual deprecations and removals,
Expand Down Expand Up @@ -444,6 +444,10 @@ In particular, do not read annotations directly from the namespace dictionary
attribute of type objects. Use :func:`annotationlib.get_annotate_from_class_namespace`
during class construction and :func:`annotationlib.get_annotations` afterwards.

In previous releases, it was sometimes possible to access class annotations from
an instance of an annotated class. This behavior was undocumented and accidental,
and will no longer work in Python 3.14.

``from __future__ import annotations``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -2501,6 +2505,11 @@ Changes in the Python API
See :ref:`above <whatsnew314-typing-union>` for more details.
(Contributed by Jelle Zijlstra in :gh:`105499`.)

* The runtime behavior of annotations has changed in various ways; see
:ref:`above <whatsnew314-pep649>` for details. While most code that interacts
with annotations should continue to work, some undocumented details may behave
differently.


Build changes
=============
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_global_objects_fini_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Include/internal/pycore_global_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(data)
STRUCT_FOR_ID(database)
STRUCT_FOR_ID(day)
STRUCT_FOR_ID(debug)
STRUCT_FOR_ID(decode)
STRUCT_FOR_ID(decoder)
STRUCT_FOR_ID(default)
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_runtime_init_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Include/internal/pycore_unicodeobject_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Lib/test/test_external_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ def _make_test_script(script_dir, script_basename, source):


def get_stack_trace(pid):
unwinder = RemoteUnwinder(pid, all_threads=True)
unwinder = RemoteUnwinder(pid, all_threads=True, debug=True)
return unwinder.get_stack_trace()


def get_async_stack_trace(pid):
unwinder = RemoteUnwinder(pid)
unwinder = RemoteUnwinder(pid, debug=True)
return unwinder.get_async_stack_trace()


def get_all_awaited_by(pid):
unwinder = RemoteUnwinder(pid)
unwinder = RemoteUnwinder(pid, debug=True)
return unwinder.get_all_awaited_by()


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:mod:`!_hashlib`: Rename internal C functions for :class:`!_hashlib.HASH`
and :class:`!_hashlib.HASHXOF` objects. Patch by Bénédikt Tran.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
If possible, ensure that :func:`uuid.getnode` returns the same result even
across different processes. Previously, the result was constant only within
the same process. Patch by Bénédikt Tran.
Loading
Loading