Skip to content

Commit d4e6ccb

Browse files
authored
Merge branch 'main' into 3.14-zstd-configure-improvements
2 parents e26de5e + 61ac88c commit d4e6ccb

34 files changed

+749
-1611
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ Lib/test/test_interpreters/ @ericsnowcurrently
298298
**/*-ios* @freakboy3742
299299

300300
# WebAssembly
301-
/Tools/wasm/ @brettcannon @freakboy3742
301+
Tools/wasm/config.site-wasm32-emscripten @freakboy3742
302+
/Tools/wasm/README.md @brettcannon @freakboy3742
303+
/Tools/wasm/wasi-env @brettcannon
304+
/Tools/wasm/wasi.py @brettcannon
305+
/Tools/wasm/emscripten @freakboy3742
306+
/Tools/wasm/wasi @brettcannon
302307

303308
# SBOM
304309
/Misc/externals.spdx.json @sethmlarson

.github/workflows/mypy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ on:
1919
- "Tools/jit/**"
2020
- "Tools/peg_generator/**"
2121
- "Tools/requirements-dev.txt"
22-
- "Tools/wasm/**"
2322
workflow_dispatch:
2423

2524
permissions:
@@ -51,7 +50,6 @@ jobs:
5150
"Tools/clinic",
5251
"Tools/jit",
5352
"Tools/peg_generator",
54-
"Tools/wasm",
5553
]
5654
steps:
5755
- uses: actions/checkout@v4

Doc/library/stdtypes.rst

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4823,7 +4823,13 @@ can be used interchangeably to index the same dictionary entry.
48234823
being added is already present, the value from the keyword argument
48244824
replaces the value from the positional argument.
48254825

4826-
To illustrate, the following examples all return a dictionary equal to
4826+
Providing keyword arguments as in the first example only works for keys that
4827+
are valid Python identifiers. Otherwise, any valid keys can be used.
4828+
4829+
Dictionaries compare equal if and only if they have the same ``(key,
4830+
value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', '>') raise
4831+
:exc:`TypeError`. To illustrate dictionary creation and equality,
4832+
the following examples all return a dictionary equal to
48274833
``{"one": 1, "two": 2, "three": 3}``::
48284834

48294835
>>> a = dict(one=1, two=2, three=3)
@@ -4838,6 +4844,27 @@ can be used interchangeably to index the same dictionary entry.
48384844
Providing keyword arguments as in the first example only works for keys that
48394845
are valid Python identifiers. Otherwise, any valid keys can be used.
48404846

4847+
Dictionaries preserve insertion order. Note that updating a key does not
4848+
affect the order. Keys added after deletion are inserted at the end. ::
4849+
4850+
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
4851+
>>> d
4852+
{'one': 1, 'two': 2, 'three': 3, 'four': 4}
4853+
>>> list(d)
4854+
['one', 'two', 'three', 'four']
4855+
>>> list(d.values())
4856+
[1, 2, 3, 4]
4857+
>>> d["one"] = 42
4858+
>>> d
4859+
{'one': 42, 'two': 2, 'three': 3, 'four': 4}
4860+
>>> del d["two"]
4861+
>>> d["two"] = None
4862+
>>> d
4863+
{'one': 42, 'three': 3, 'four': 4, 'two': None}
4864+
4865+
.. versionchanged:: 3.7
4866+
Dictionary order is guaranteed to be insertion order. This behavior was
4867+
an implementation detail of CPython from 3.6.
48414868

48424869
These are the operations that dictionaries support (and therefore, custom
48434870
mapping types should support too):
@@ -5008,32 +5035,6 @@ can be used interchangeably to index the same dictionary entry.
50085035

50095036
.. versionadded:: 3.9
50105037

5011-
Dictionaries compare equal if and only if they have the same ``(key,
5012-
value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', '>') raise
5013-
:exc:`TypeError`.
5014-
5015-
Dictionaries preserve insertion order. Note that updating a key does not
5016-
affect the order. Keys added after deletion are inserted at the end. ::
5017-
5018-
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
5019-
>>> d
5020-
{'one': 1, 'two': 2, 'three': 3, 'four': 4}
5021-
>>> list(d)
5022-
['one', 'two', 'three', 'four']
5023-
>>> list(d.values())
5024-
[1, 2, 3, 4]
5025-
>>> d["one"] = 42
5026-
>>> d
5027-
{'one': 42, 'two': 2, 'three': 3, 'four': 4}
5028-
>>> del d["two"]
5029-
>>> d["two"] = None
5030-
>>> d
5031-
{'one': 42, 'three': 3, 'four': 4, 'two': None}
5032-
5033-
.. versionchanged:: 3.7
5034-
Dictionary order is guaranteed to be insertion order. This behavior was
5035-
an implementation detail of CPython from 3.6.
5036-
50375038
Dictionaries and dictionary views are reversible. ::
50385039

50395040
>>> d = {"one": 1, "two": 2, "three": 3, "four": 4}

Doc/tools/extensions/pyspecific.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from sphinx.util.docutils import SphinxDirective
2323

2424
# Used in conf.py and updated here by python/release-tools/run_release.py
25-
SOURCE_URI = 'https://github.com/python/cpython/tree/3.14/%s'
25+
SOURCE_URI = 'https://github.com/python/cpython/tree/main/%s'
2626

2727
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
2828
from docutils.parsers.rst.states import Body

Doc/whatsnew/3.15.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ New features
139139
------------
140140

141141
* TODO
142+
142143
Porting to Python 3.15
143144
----------------------
144145

Doc/whatsnew/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ anyone wishing to stay up-to-date after a new release.
1111
.. toctree::
1212
:maxdepth: 2
1313

14+
3.15.rst
1415
3.14.rst
1516
3.13.rst
1617
3.12.rst

Include/internal/pycore_magic_number.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ Known values:
277277
Python 3.14a7 3622 (Store annotations in different class dict keys)
278278
Python 3.14a7 3623 (Add BUILD_INTERPOLATION & BUILD_TEMPLATE opcodes)
279279
Python 3.14b1 3624 (Don't optimize LOAD_FAST when local is killed by DELETE_FAST)
280+
Python 3.15a0 3650 (Initial version)
280281
281-
Python 3.15 will start with 3650
282+
Python 3.16 will start with 3700
282283
283284
Please don't copy-paste the same pre-release tag for new entries above!!!
284285
You should always use the *upcoming* tag. For example, if 3.12a6 came out
@@ -289,7 +290,7 @@ PC/launcher.c must also be updated.
289290
290291
*/
291292

292-
#define PYC_MAGIC_NUMBER 3624
293+
#define PYC_MAGIC_NUMBER 3650
293294
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
294295
(little-endian) and then appending b'\r\n'. */
295296
#define PYC_MAGIC_NUMBER_TOKEN \

Lib/curses/__init__.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ def initscr():
3030
fd=_sys.__stdout__.fileno())
3131
stdscr = _curses.initscr()
3232
for key, value in _curses.__dict__.items():
33-
if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
33+
if key.startswith('ACS_') or key in ('LINES', 'COLS'):
3434
setattr(curses, key, value)
35-
3635
return stdscr
3736

3837
# This is a similar wrapper for start_color(), which adds the COLORS and
@@ -41,12 +40,9 @@ def initscr():
4140

4241
def start_color():
4342
import _curses, curses
44-
retval = _curses.start_color()
45-
if hasattr(_curses, 'COLORS'):
46-
curses.COLORS = _curses.COLORS
47-
if hasattr(_curses, 'COLOR_PAIRS'):
48-
curses.COLOR_PAIRS = _curses.COLOR_PAIRS
49-
return retval
43+
_curses.start_color()
44+
curses.COLORS = _curses.COLORS
45+
curses.COLOR_PAIRS = _curses.COLOR_PAIRS
5046

5147
# Import Python has_key() implementation if _curses doesn't contain has_key()
5248

@@ -85,10 +81,11 @@ def wrapper(func, /, *args, **kwds):
8581
# Start color, too. Harmless if the terminal doesn't have
8682
# color; user can test with has_color() later on. The try/catch
8783
# works around a minor bit of over-conscientiousness in the curses
88-
# module -- the error return from C start_color() is ignorable.
84+
# module -- the error return from C start_color() is ignorable,
85+
# unless they are raised by the interpreter due to other issues.
8986
try:
9087
start_color()
91-
except:
88+
except _curses.error:
9289
pass
9390

9491
return func(stdscr, *args, **kwds)

Lib/sysconfig/__init__.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,7 @@ def _safe_realpath(path):
219219
if "_PYTHON_PROJECT_BASE" in os.environ:
220220
_PROJECT_BASE = _safe_realpath(os.environ["_PYTHON_PROJECT_BASE"])
221221

222-
def is_python_build(check_home=None):
223-
if check_home is not None:
224-
import warnings
225-
warnings.warn(
226-
(
227-
'The check_home argument of sysconfig.is_python_build is '
228-
'deprecated and its value is ignored. '
229-
'It will be removed in Python 3.15.'
230-
),
231-
DeprecationWarning,
232-
stacklevel=2,
233-
)
222+
def is_python_build():
234223
for fn in ("Setup", "Setup.local"):
235224
if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)):
236225
return True

Lib/test/test_ast/test_ast.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,17 @@ def test_constant_as_name(self):
821821
with self.assertRaisesRegex(ValueError, f"identifier field can't represent '{constant}' constant"):
822822
compile(expr, "<test>", "eval")
823823

824+
def test_constant_as_unicode_name(self):
825+
constants = [
826+
("True", b"Tru\xe1\xb5\x89"),
827+
("False", b"Fal\xc5\xbfe"),
828+
("None", b"N\xc2\xbane"),
829+
]
830+
for constant in constants:
831+
with self.assertRaisesRegex(ValueError,
832+
f"identifier field can't represent '{constant[0]}' constant"):
833+
ast.parse(constant[1], mode="eval")
834+
824835
def test_precedence_enum(self):
825836
class _Precedence(enum.IntEnum):
826837
"""Precedence table that originated from python grammar."""

0 commit comments

Comments
 (0)