Skip to content

Commit dc660a2

Browse files
committed
Merge branch 'main' into tier-2-tos-caching
2 parents 492ecda + f278afc commit dc660a2

Some content is hidden

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

44 files changed

+2942
-943
lines changed

.github/workflows/tail-call.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ jobs:
114114
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
115115
brew install llvm@${{ matrix.llvm }}
116116
export SDKROOT="$(xcrun --show-sdk-path)"
117-
export PATH="/usr/local/opt/llvm/bin:$PATH"
118-
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
117+
export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
118+
export PATH="/opt/homebrew/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
119119
CC=clang-20 ./configure --with-tail-call-interp
120120
make all --jobs 4
121121
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ iOS/testbed/Python.xcframework/ios-*/lib
8080
iOS/testbed/Python.xcframework/ios-*/Python.framework
8181
iOS/testbed/iOSTestbed.xcodeproj/project.xcworkspace
8282
iOS/testbed/iOSTestbed.xcodeproj/xcuserdata
83-
iOS/testbed/iOSTestbed.xcodeproj/xcshareddata
8483
Mac/Makefile
8584
Mac/PythonLauncher/Info.plist
8685
Mac/PythonLauncher/Makefile

Doc/library/curses.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ the following methods and attributes:
770770

771771
.. method:: window.attron(attr)
772772

773-
Add attribute *attr* from the "background" set applied to all writes to the
773+
Add attribute *attr* to the "background" set applied to all writes to the
774774
current window.
775775

776776

Doc/library/imaplib.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ An :class:`IMAP4` instance has the following methods:
413413
the password. Will only work if the server ``CAPABILITY`` response includes the
414414
phrase ``AUTH=CRAM-MD5``.
415415

416+
.. versionchanged:: next
417+
An :exc:`IMAP4.error` is raised if MD5 support is not available.
418+
416419

417420
.. method:: IMAP4.logout()
418421

Doc/library/sys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
17641764
:func:`settrace` for each thread being debugged or use :func:`threading.settrace`.
17651765

17661766
Trace functions should have three arguments: *frame*, *event*, and
1767-
*arg*. *frame* is the current stack frame. *event* is a string: ``'call'``,
1767+
*arg*. *frame* is the :ref:`current stack frame <frame-objects>`. *event* is a string: ``'call'``,
17681768
``'line'``, ``'return'``, ``'exception'`` or ``'opcode'``. *arg* depends on
17691769
the event type.
17701770

Doc/reference/simple_stmts.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,10 +971,17 @@ as globals. It would be impossible to assign to a global variable without
971971
:keyword:`!global`, although free variables may refer to globals without being
972972
declared global.
973973

974-
The :keyword:`global` statement applies to the entire scope of a function or
975-
class body. A :exc:`SyntaxError` is raised if a variable is used or
974+
The :keyword:`!global` statement applies to the entire current scope
975+
(module, function body or class definition).
976+
A :exc:`SyntaxError` is raised if a variable is used or
976977
assigned to prior to its global declaration in the scope.
977978

979+
At the module level, all variables are global, so a :keyword:`!global`
980+
statement has no effect.
981+
However, variables must still not be used or
982+
assigned to prior to their :keyword:`!global` declaration.
983+
This requirement is relaxed in the interactive prompt (:term:`REPL`).
984+
978985
.. index::
979986
pair: built-in function; exec
980987
pair: built-in function; eval

Doc/tutorial/classes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ Usually, a method is called right after it is bound::
359359

360360
x.f()
361361

362-
In the :class:`!MyClass` example, this will return the string ``'hello world'``.
362+
If ``x = MyClass()``, as above, this will return the string ``'hello world'``.
363363
However, it is not necessary to call a method right away: ``x.f`` is a method
364364
object, and can be stored away and called at a later time. For example::
365365

Doc/using/ios.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,17 @@ You can also open the testbed project in Xcode by running:
374374
375375
This will allow you to use the full Xcode suite of tools for debugging.
376376

377+
The arguments used to run the test suite are defined as part of the test plan.
378+
To modify the test plan, select the test plan node of the project tree (it
379+
should be the first child of the root node), and select the "Configurations"
380+
tab. Modify the "Arguments Passed On Launch" value to change the testing
381+
arguments.
382+
383+
The test plan also disables parallel testing, and specifies the use of the
384+
``iOSTestbed.lldbinit`` file for providing configuration of the debugger. The
385+
default debugger configuration disables automatic breakpoints on the
386+
``SIGINT``, ``SIGUSR1``, ``SIGUSR2``, and ``SIGXFSZ`` signals.
387+
377388
App Store Compliance
378389
====================
379390

Doc/whatsnew/3.14.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Summary -- release highlights
6565
.. This section singles out the most important changes in Python 3.14.
6666
Brevity is key.
6767
68-
Python 3.14 beta is the pre-release of the next version of the Python
68+
Python 3.14 will be the latest stable release of the Python
6969
programming language, with a mix of changes to the language, the
7070
implementation and the standard library.
7171

@@ -635,7 +635,7 @@ Improved error messages
635635
misspellings may still result in regular syntax errors.
636636
(Contributed by Pablo Galindo in :gh:`132449`.)
637637

638-
* When unpacking assignment fails due to incorrect number of variables, the
638+
* When an unpacking assignment fails due to an incorrect number of variables, the
639639
error message prints the received number of values in more cases than before.
640640
(Contributed by Tushar Sadhwani in :gh:`122239`.)
641641

@@ -763,7 +763,7 @@ ABI-compatible changes in the future.
763763

764764
Complete the :pep:`587` :ref:`PyConfig C API <pyconfig_api>` by adding
765765
:c:func:`PyInitConfig_AddModule` which can be used to add a built-in extension
766-
module; feature previously referred to as the “inittab”.
766+
module; a feature previously referred to as the “inittab”.
767767

768768
Add :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions to get and set
769769
the current runtime configuration.
@@ -1051,7 +1051,7 @@ Concurrent safe warnings control
10511051
The :class:`warnings.catch_warnings` context manager will now optionally
10521052
use a context variable for warning filters. This is enabled by setting
10531053
the :data:`~sys.flags.context_aware_warnings` flag, either with the ``-X``
1054-
command-line option or an environment variable. This gives predicable
1054+
command-line option or an environment variable. This gives predictable
10551055
warnings control when using :class:`~warnings.catch_warnings` combined with
10561056
multiple threads or asynchronous tasks. The flag defaults to true for the
10571057
free-threaded build and false for the GIL-enabled build.
@@ -1152,7 +1152,7 @@ Other language changes
11521152
unlike ``\Z``, which has subtly different behavior.
11531153
(Contributed by Serhiy Storchaka in :gh:`133306`.)
11541154

1155-
* ``\B`` in :mod:`regular expression <re>` now matches empty input string.
1155+
* ``\B`` in :mod:`regular expression <re>` now matches the empty input string.
11561156
Now it is always the opposite of ``\b``.
11571157
(Contributed by Serhiy Storchaka in :gh:`124130`.)
11581158

@@ -1221,7 +1221,7 @@ PEP 765: Disallow ``return``/``break``/``continue`` that exit a ``finally`` bloc
12211221
---------------------------------------------------------------------------------
12221222

12231223
The compiler emits a :exc:`SyntaxWarning` when a :keyword:`return`, :keyword:`break` or
1224-
:keyword:`continue` statements appears where it exits a :keyword:`finally` block.
1224+
:keyword:`continue` statement appears where it exits a :keyword:`finally` block.
12251225
This change is specified in :pep:`765`.
12261226

12271227

@@ -1278,7 +1278,7 @@ ast
12781278
(Contributed by Irit Katriel in :gh:`130139`.)
12791279

12801280
* Add new ``--feature-version``, ``--optimize``, ``--show-empty`` options to
1281-
command-line interface.
1281+
the command-line interface.
12821282
(Contributed by Semyon Moroz in :gh:`133367`.)
12831283

12841284

@@ -2157,7 +2157,7 @@ unittest
21572157
:meth:`~unittest.TestCase.assertNotStartsWith`,
21582158
:meth:`~unittest.TestCase.assertEndsWith` and
21592159
:meth:`~unittest.TestCase.assertNotEndsWith` check whether the Unicode
2160-
or byte string starts or ends with particular string(s).
2160+
or byte string starts or ends with particular strings.
21612161

21622162
(Contributed by Serhiy Storchaka in :gh:`71339`.)
21632163

@@ -2223,15 +2223,15 @@ webbrowser
22232223
supported browsers on macOS.
22242224

22252225

2226-
zipinfo
2226+
zipfile
22272227
-------
22282228

22292229
* Added :func:`ZipInfo._for_archive <zipfile.ZipInfo._for_archive>`
22302230
to resolve suitable defaults for a :class:`~zipfile.ZipInfo` object
22312231
as used by :func:`ZipFile.writestr <zipfile.ZipFile.writestr>`.
22322232
(Contributed by Bénédikt Tran in :gh:`123424`.)
22332233

2234-
* :meth:`zipfile.ZipFile.writestr` now respect ``SOURCE_DATE_EPOCH`` that
2234+
* :meth:`zipfile.ZipFile.writestr` now respects ``SOURCE_DATE_EPOCH`` that
22352235
distributions can set centrally and have build tools consume this in order
22362236
to produce reproducible output.
22372237
(Contributed by Jiahao Li in :gh:`91279`.)
@@ -2379,7 +2379,7 @@ zlib
23792379
* On Windows, `zlib-ng <https://github.com/zlib-ng/zlib-ng>`__
23802380
is now used as the implementation of the :mod:`zlib` module
23812381
in the default binaries.
2382-
There are no known incompatabilities between ``zlib-ng``
2382+
There are no known incompatibilities between ``zlib-ng``
23832383
and the previously-used ``zlib`` implementation.
23842384
This should result in better performance at all compression levels.
23852385

@@ -2839,7 +2839,7 @@ Changes in the Python API
28392839
rather than collecting generation 1.
28402840
* Other calls to :func:`!gc.collect` are unchanged.
28412841

2842-
* The :func:`locale.nl_langinfo` function now sets temporarily the ``LC_CTYPE``
2842+
* The :func:`locale.nl_langinfo` function now temporarily sets the ``LC_CTYPE``
28432843
locale in some cases.
28442844
This temporary change affects other threads.
28452845
(Contributed by Serhiy Storchaka in :gh:`69998`.)
@@ -3019,8 +3019,8 @@ New features
30193019
and get an attribute of the module.
30203020
(Contributed by Victor Stinner in :gh:`128911`.)
30213021

3022-
* Add support for a new ``p`` format unit in :c:func:`Py_BuildValue` that allows to
3023-
take a C integer and produce a Python :class:`bool` object. (Contributed by
3022+
* Add support for a new ``p`` format unit in :c:func:`Py_BuildValue` that allows
3023+
taking a C integer and produces a Python :class:`bool` object. (Contributed by
30243024
Pablo Galindo in :issue:`45325`.)
30253025

30263026
* Add :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` to determine if an object

Doc/whatsnew/3.15.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,45 @@ production systems where traditional profiling approaches would be too intrusive
169169
(Contributed by Pablo Galindo and László Kiss Kollár in :gh:`135953`.)
170170

171171

172+
Improved error messages
173+
-----------------------
174+
175+
* The interpreter now provides more helpful suggestions in :exc:`AttributeError`
176+
exceptions when accessing an attribute on an object that does not exist, but
177+
a similar attribute is available through one of its members.
178+
179+
For example, if the object has an attribute that itself exposes the requested
180+
name, the error message will suggest accessing it via that inner attribute:
181+
182+
.. code-block:: python
183+
184+
@dataclass
185+
class Circle:
186+
radius: float
187+
188+
@property
189+
def area(self) -> float:
190+
return pi * self.radius**2
191+
192+
class Container:
193+
def __init__(self, inner: Circle) -> None:
194+
self.inner = inner
195+
196+
circle = Circle(radius=4.0)
197+
container = Container(circle)
198+
print(container.area)
199+
200+
Running this code now produces a clearer suggestion:
201+
202+
.. code-block:: pycon
203+
204+
Traceback (most recent call last):
205+
File "/home/pablogsal/github/python/main/lel.py", line 42, in <module>
206+
print(container.area)
207+
^^^^^^^^^^^^^^
208+
AttributeError: 'Container' object has no attribute 'area'. Did you mean: 'inner.area'?
209+
210+
172211
Other language changes
173212
======================
174213

@@ -200,6 +239,25 @@ Other language changes
200239
* Several error messages incorrectly using the term "argument" have been corrected.
201240
(Contributed by Stan Ulbrych in :gh:`133382`.)
202241

242+
* The interpreter now tries to provide a suggestion when
243+
:func:`delattr` fails due to a missing attribute.
244+
When an attribute name that closely resembles an existing attribute is used,
245+
the interpreter will suggest the correct attribute name in the error message.
246+
For example:
247+
248+
.. doctest::
249+
250+
>>> class A:
251+
... pass
252+
>>> a = A()
253+
>>> a.abcde = 1
254+
>>> del a.abcdf # doctest: +ELLIPSIS
255+
Traceback (most recent call last):
256+
...
257+
AttributeError: 'A' object has no attribute 'abcdf'. Did you mean: 'abcde'?
258+
259+
(Contributed by Nikita Sobolev and Pranjal Prajapati in :gh:`136588`.)
260+
203261
* Unraisable exceptions are now highlighted with color by default. This can be
204262
controlled by :ref:`environment variables <using-on-controlling-color>`.
205263
(Contributed by Peter Bierma in :gh:`134170`.)

0 commit comments

Comments
 (0)