Skip to content

Commit 26cde89

Browse files
committed
Merge branch 'master' into deprecate-struct-init-2/78724
2 parents 7f0a133 + 09e8c38 commit 26cde89

File tree

124 files changed

+1019
-607
lines changed

Some content is hidden

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

124 files changed

+1019
-607
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ InternalDocs/jit.md @brandtbucher @savannahostrowski @diegorusso @AA-T
298298
# Lazy imports (PEP 810)
299299
Objects/lazyimportobject.c @yhg1s @DinoV @pablogsal
300300
Include/internal/pycore_lazyimportobject.h @yhg1s @DinoV @pablogsal
301-
Lib/test/test_import/test_lazy_imports.py @yhg1s @DinoV @pablogsal
302-
Lib/test/test_import/data/lazy_imports/ @yhg1s @DinoV @pablogsal
301+
Lib/test/test_lazy_import @yhg1s @DinoV @pablogsal
303302

304303
# Micro-op / μop / Tier 2 Optimiser
305304
Python/optimizer.c @markshannon @Fidget-Spinner

Doc/c-api/dict.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ Dictionary objects
8282
8383
Return a new dictionary that contains the same key-value pairs as *p*.
8484
85+
.. versionchanged:: next
86+
If *p* is a subclass of :class:`frozendict`, the result will be a
87+
:class:`frozendict` instance instead of a :class:`dict` instance.
8588
8689
.. c:function:: int PyDict_SetItem(PyObject *p, PyObject *key, PyObject *val)
8790

Doc/c-api/frame.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ See also :ref:`Reflection <reflection>`.
5050
5151
Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer
5252
frame.
53+
This raises no exceptions.
5354
5455
.. versionadded:: 3.9
5556

Doc/c-api/typeobj.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,52 @@ and :c:data:`PyType_Type` effectively act as defaults.)
14991499
It will be removed in a future version of CPython
15001500

15011501

1502+
.. c:macro:: Py_TPFLAGS_HAVE_VERSION_TAG
1503+
1504+
This is a :term:`soft deprecated` macro that does nothing.
1505+
Historically, this would indicate that the
1506+
:c:member:`~PyTypeObject.tp_version_tag` field was available and
1507+
initialized.
1508+
1509+
1510+
.. c:macro:: Py_TPFLAGS_INLINE_VALUES
1511+
1512+
This bit indicates that instances of this type will have an "inline values"
1513+
array (containing the object's attributes) placed directly after the end
1514+
of the object.
1515+
1516+
This requires that :c:macro:`Py_TPFLAGS_HAVE_GC` is set.
1517+
1518+
**Inheritance:**
1519+
1520+
This flag is not inherited.
1521+
1522+
.. versionadded:: 3.13
1523+
1524+
1525+
.. c:macro:: Py_TPFLAGS_IS_ABSTRACT
1526+
1527+
This bit indicates that this is an abstract type and therefore cannot
1528+
be instantiated.
1529+
1530+
**Inheritance:**
1531+
1532+
This flag is not inherited.
1533+
1534+
.. seealso::
1535+
:mod:`abc`
1536+
1537+
1538+
.. c:macro:: Py_TPFLAGS_HAVE_STACKLESS_EXTENSION
1539+
1540+
Internal. Do not set or unset this flag.
1541+
Historically, this was a reserved flag for use in Stackless Python.
1542+
1543+
.. warning::
1544+
This flag is present in header files, but is not be used.
1545+
This may be removed in a future version of CPython.
1546+
1547+
15021548
.. c:member:: const char* PyTypeObject.tp_doc
15031549
15041550
.. corresponding-type-slot:: Py_tp_doc

Doc/deprecations/pending-removal-in-3.20.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Pending removal in Python 3.20
2828
- :mod:`re`
2929
- :mod:`socketserver`
3030
- :mod:`tabnanny`
31+
- :mod:`tarfile`
3132
- :mod:`tkinter.font`
3233
- :mod:`tkinter.ttk`
3334
- :mod:`wsgiref.simple_server`

Doc/library/stdtypes.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2504,6 +2504,19 @@ expression support in the :mod:`re` module).
25042504
done using the specified *fillchar* (default is an ASCII space). The
25052505
original string is returned if *width* is less than or equal to ``len(s)``.
25062506

2507+
For example:
2508+
2509+
.. doctest::
2510+
2511+
>>> 'Python'.rjust(10)
2512+
' Python'
2513+
>>> 'Python'.rjust(10, '.')
2514+
'....Python'
2515+
>>> 'Monty Python'.rjust(10, '.')
2516+
'Monty Python'
2517+
2518+
See also :meth:`ljust` and :meth:`zfill`.
2519+
25072520

25082521
.. method:: str.rpartition(sep, /)
25092522

@@ -2828,13 +2841,17 @@ expression support in the :mod:`re` module).
28282841
than before. The original string is returned if *width* is less than
28292842
or equal to ``len(s)``.
28302843

2831-
For example::
2844+
For example:
2845+
2846+
.. doctest::
28322847

28332848
>>> "42".zfill(5)
28342849
'00042'
28352850
>>> "-42".zfill(5)
28362851
'-0042'
28372852

2853+
See also :meth:`rjust`.
2854+
28382855

28392856
.. index::
28402857
single: ! formatted string literal

Doc/library/typing.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3353,8 +3353,8 @@ Introspection helpers
33533353

33543354
.. function:: get_type_hints(obj, globalns=None, localns=None, include_extras=False)
33553355

3356-
Return a dictionary containing type hints for a function, method, module
3357-
or class object.
3356+
Return a dictionary containing type hints for a function, method, module,
3357+
class object, or other callable object.
33583358

33593359
This is often the same as ``obj.__annotations__``, but this function makes
33603360
the following changes to the annotations dictionary:
@@ -3395,6 +3395,13 @@ Introspection helpers
33953395
:ref:`type aliases <type-aliases>` that include forward references,
33963396
or with names imported under :data:`if TYPE_CHECKING <TYPE_CHECKING>`.
33973397

3398+
.. note::
3399+
3400+
Calling :func:`get_type_hints` on an instance is not supported.
3401+
To retrieve annotations for an instance, call
3402+
:func:`get_type_hints` on the instance's class instead
3403+
(for example, ``get_type_hints(type(obj))``).
3404+
33983405
.. versionchanged:: 3.9
33993406
Added ``include_extras`` parameter as part of :pep:`593`.
34003407
See the documentation on :data:`Annotated` for more information.
@@ -3404,6 +3411,11 @@ Introspection helpers
34043411
if a default value equal to ``None`` was set.
34053412
Now the annotation is returned unchanged.
34063413

3414+
.. versionchanged:: 3.14
3415+
Calling :func:`get_type_hints` on instances is no longer supported.
3416+
Some instances were accepted in earlier versions as an undocumented
3417+
implementation detail.
3418+
34073419
.. function:: get_origin(tp)
34083420

34093421
Get the unsubscripted version of a type: for a typing object of the form

Doc/reference/datamodel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ Basic customization
22562256
This is intended to provide protection against a denial-of-service caused
22572257
by carefully chosen inputs that exploit the worst case performance of a
22582258
dict insertion, *O*\ (*n*\ :sup:`2`) complexity. See
2259-
http://ocert.org/advisories/ocert-2011-003.html for details.
2259+
https://ocert.org/advisories/ocert-2011-003.html for details.
22602260

22612261
Changing hash values affects the iteration order of sets.
22622262
Python has never made guarantees about this ordering

Doc/using/cmdline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ Miscellaneous options
390390
Hash randomization is intended to provide protection against a
391391
denial-of-service caused by carefully chosen inputs that exploit the worst
392392
case performance of a dict construction, *O*\ (*n*\ :sup:`2`) complexity. See
393-
http://ocert.org/advisories/ocert-2011-003.html for details.
393+
https://ocert.org/advisories/ocert-2011-003.html for details.
394394

395395
:envvar:`PYTHONHASHSEED` allows you to set a fixed value for the hash
396396
seed secret.

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,7 @@ New deprecations
15581558
- :mod:`re`
15591559
- :mod:`socketserver`
15601560
- :mod:`tabnanny`
1561+
- :mod:`tarfile`
15611562
- :mod:`tkinter.font`
15621563
- :mod:`tkinter.ttk`
15631564
- :mod:`wsgiref.simple_server`

0 commit comments

Comments
 (0)