Skip to content

Commit 3047b8f

Browse files
Merge branch 'main' into gh-144957-lazy-import-test and fix test path
2 parents e7def6c + 61ebb99 commit 3047b8f

107 files changed

Lines changed: 916 additions & 597 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.

.github/CODEOWNERS

Lines changed: 14 additions & 15 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
@@ -426,19 +425,19 @@ Lib/dataclasses.py @ericvsmith
426425
Lib/test/test_dataclasses/ @ericvsmith
427426

428427
# Dates and times
429-
Doc/**/*time.rst @pganssle @abalkin
430-
Doc/library/datetime-* @pganssle
431-
Doc/library/zoneinfo.rst @pganssle
432-
Include/datetime.h @pganssle @abalkin
433-
Include/internal/pycore_time.h @pganssle @abalkin
434-
Lib/test/test_zoneinfo/ @pganssle
435-
Lib/zoneinfo/ @pganssle
436-
Lib/*time.py @pganssle @abalkin
437-
Lib/test/datetimetester.py @pganssle @abalkin
438-
Lib/test/test_*time.py @pganssle @abalkin
439-
Modules/*zoneinfo* @pganssle
440-
Modules/*time* @pganssle @abalkin
441-
Python/pytime.c @pganssle @abalkin
428+
Doc/**/*time.rst @pganssle @abalkin @StanFromIreland
429+
Doc/library/datetime-* @pganssle @StanFromIreland
430+
Doc/library/zoneinfo.rst @pganssle @StanFromIreland
431+
Include/datetime.h @pganssle @abalkin @StanFromIreland
432+
Include/internal/pycore_time.h @pganssle @abalkin @StanFromIreland
433+
Lib/test/test_zoneinfo/ @pganssle @StanFromIreland
434+
Lib/zoneinfo/ @pganssle @StanFromIreland
435+
Lib/*time.py @pganssle @abalkin @StanFromIreland
436+
Lib/test/datetimetester.py @pganssle @abalkin @StanFromIreland
437+
Lib/test/test_*time.py @pganssle @abalkin @StanFromIreland
438+
Modules/*zoneinfo* @pganssle @StanFromIreland
439+
Modules/*time* @pganssle @abalkin @StanFromIreland
440+
Python/pytime.c @pganssle @abalkin @StanFromIreland
442441

443442
# Dbm
444443
Doc/library/dbm.rst @corona10 @erlend-aasland @serhiy-storchaka

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
@@ -21,6 +21,7 @@ Pending removal in Python 3.20
2121
- :mod:`re`
2222
- :mod:`socketserver`
2323
- :mod:`tabnanny`
24+
- :mod:`tarfile`
2425
- :mod:`tkinter.font`
2526
- :mod:`tkinter.ttk`
2627
- :mod:`wsgiref.simple_server`

Doc/library/bisect.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ example uses :py:func:`~bisect.bisect` to look up a letter grade for an exam sco
200200
based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 to 89 is
201201
a 'B', and so on::
202202

203-
>>> def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):
204-
... i = bisect(breakpoints, score)
205-
... return grades[i]
203+
>>> def grade(score)
204+
... i = bisect([60, 70, 80, 90], score)
205+
... return "FDCBA"[i]
206206
...
207207
>>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]
208208
['F', 'A', 'C', 'C', 'B', 'A', 'A']

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
@@ -1549,6 +1549,7 @@ New deprecations
15491549
- :mod:`re`
15501550
- :mod:`socketserver`
15511551
- :mod:`tabnanny`
1552+
- :mod:`tarfile`
15521553
- :mod:`tkinter.font`
15531554
- :mod:`tkinter.ttk`
15541555
- :mod:`wsgiref.simple_server`

Grammar/python.gram

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,8 @@ invalid_import_from_targets:
14471447
RAISE_SYNTAX_ERROR_STARTING_FROM(token, "Expected one or more names after 'import'") }
14481448

14491449
invalid_with_stmt:
1450+
| ['async'] 'with' ','.(expression ['as' star_target])+ trailing=',' ':' {
1451+
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(trailing, "the last 'with' item has a trailing comma") }
14501452
| ['async'] 'with' ','.(expression ['as' star_target])+ NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
14511453
| ['async'] 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
14521454
invalid_with_stmt_indent:

Lib/locale.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,6 @@ def _getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
570570
except (ImportError, AttributeError):
571571
pass
572572
else:
573-
# make sure the code/encoding values are valid
574-
if sys.platform == "win32" and code and code[:2] == "0x":
575-
# map windows language identifier to language name
576-
code = windows_locale.get(int(code, 0))
577573
# ...add other platform-specific processing here, if
578574
# necessary...
579575
return code, encoding

0 commit comments

Comments
 (0)