]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agoImprove the section with SyntaxError message improvements to the What's New of 3...
Pablo Galindo [Fri, 16 Apr 2021 00:28:48 +0000 (01:28 +0100)] 
Improve the section with SyntaxError message improvements to the What's New of 3.10 (GH-25428)

4 years agobpo-43823: Fix location of one of the errors for invalid dictionary literals (GH...
Pablo Galindo [Thu, 15 Apr 2021 23:45:42 +0000 (00:45 +0100)] 
bpo-43823: Fix location of one of the errors for invalid dictionary literals (GH-25427)

4 years agobpo-43822: Improve syntax errors for missing commas (GH-25377)
Pablo Galindo [Thu, 15 Apr 2021 20:38:45 +0000 (21:38 +0100)] 
bpo-43822: Improve syntax errors for missing commas (GH-25377)

4 years agoUpdate ACKS (GH-25423)
Ethan Furman [Thu, 15 Apr 2021 14:55:46 +0000 (07:55 -0700)] 
Update ACKS (GH-25423)

* Add Arseny Boykov
* Add Matthias Urlichs

4 years agobpo-43744: [Enum] fix ``_is_private`` (GH-25349)
Ethan Furman [Thu, 15 Apr 2021 13:58:33 +0000 (06:58 -0700)] 
bpo-43744: [Enum] fix ``_is_private`` (GH-25349)

``_is_private`` now returns ``False`` instead of raising an exception when enum name matches beginning of class name
as used in a private variable

4 years ago[Enum] fix doc string (GH-25376)
Ethan Furman [Thu, 15 Apr 2021 13:49:54 +0000 (06:49 -0700)] 
[Enum] fix doc string (GH-25376)

4 years agobpo-43846: Use less stack for large literals and calls (GH-25403)
Mark Shannon [Thu, 15 Apr 2021 13:28:56 +0000 (14:28 +0100)] 
bpo-43846: Use less stack for large literals and calls (GH-25403)

* Modify compiler to reduce stack consumption for large expressions.

* Add more tests for stack usage.

* Add NEWS item.

* Raise SystemError for truly excessive stack use.

4 years agobpo-43823: Improve syntax errors for invalid dictionary literals (GH-25378)
Pablo Galindo [Thu, 15 Apr 2021 13:06:39 +0000 (14:06 +0100)] 
bpo-43823: Improve syntax errors for invalid dictionary literals (GH-25378)

4 years agobpo-37741: make importlib.metadata docs discoverable through a module directive....
Jason R. Coombs [Thu, 15 Apr 2021 00:56:21 +0000 (20:56 -0400)] 
bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415)

Automerge-Triggered-By: GH:jaraco
4 years agobpo-38530: Optimize the calculation of string sizes when offering suggestions (GH...
Pablo Galindo [Wed, 14 Apr 2021 23:03:43 +0000 (00:03 +0100)] 
bpo-38530: Optimize the calculation of string sizes when offering suggestions (GH-25412)

4 years agobpo-43296: Handle sqlite3_value_blob() errors (GH-24674)
Erlend Egeberg Aasland [Wed, 14 Apr 2021 21:09:11 +0000 (23:09 +0200)] 
bpo-43296: Handle sqlite3_value_blob() errors (GH-24674)

4 years agobpo-38530: Make sure that failing to generate suggestions on failure will not propaga...
Pablo Galindo [Wed, 14 Apr 2021 17:58:28 +0000 (18:58 +0100)] 
bpo-38530: Make sure that failing to generate suggestions on failure will not propagate exceptions (GH-25408)

4 years agoFix typo in 3.10's What's New documentation (GH-25409)
Zackery Spytz [Wed, 14 Apr 2021 16:16:11 +0000 (10:16 -0600)] 
Fix typo in 3.10's What's New documentation (GH-25409)

"occured" ->  "occurred"

4 years agobpo-41282: (PEP 632) Load install schemes from sysconfig (GH-24549)
Lumír 'Frenzy' Balhar [Wed, 14 Apr 2021 15:12:34 +0000 (17:12 +0200)] 
bpo-41282: (PEP 632) Load install schemes from sysconfig (GH-24549)

With this patch, `distutils.command.install.INSTALL_SCHEMES` are loaded from
`sysconfig._INSTALL_SCHEMES`.

The distutils module is deprecated and will be removed in 3.12 (PEP 632).
This change makes the `sysconfig._INSTALL_SCHEMES` the single point of truth
for install schemes while keeping `distutils.command.install.INSTALL_SCHEMES`
exactly the same. If we, during the transition to the sysconfig, change
something, this makes sure that it also propagates to distutils until the
module gets removed.

Moreover, as discussed [on Discourse], Linux distros need to patch
distutils/sysconfig to make sure the packages will land in proper locations.
This patch makes it easier because it leaves only one location where install
schemes are defined which is much easier to patch/adjust.

[on Discourse]: https://discuss.python.org/t/pep-632-deprecate-distutils-module/5134

The implementation is slightly different than the plan but I think it's the
easiest way how to do it and it also makes the downstream patch simple,
flexible and easy to maintain.

It's also necessary to implement this before setuptools starts bundling
the distutils module so the default install schemes stay in the standard library.

The removed code from sysconfig does not seem to have any negative effect
because, honestly, it seems that nothing actually uses the install schemes
from sysconfig at all. There were many big changes in these modules where
they were trying to include packaging in stdlib and then reverted that.
Also, the test of distutils install command does not count with the different
locations which is good evidence that the reason to have this piece of code
is no longer valid.

https://bugs.python.org/issue41282

4 years agobpo-43505: Explicitly initialize and shutdown sqlite3 (GH-25404)
Erlend Egeberg Aasland [Wed, 14 Apr 2021 14:50:16 +0000 (16:50 +0200)] 
bpo-43505: Explicitly initialize and shutdown sqlite3 (GH-25404)

4 years agobpo-41282: setup.py ignores distutils DeprecationWarning (GH-25405)
Victor Stinner [Wed, 14 Apr 2021 14:38:58 +0000 (16:38 +0200)] 
bpo-41282: setup.py ignores distutils DeprecationWarning (GH-25405)

4 years agobpo-43795: Sort PC/python3dll.c (GH-25312)
Petr Viktorin [Wed, 14 Apr 2021 14:38:30 +0000 (16:38 +0200)] 
bpo-43795: Sort PC/python3dll.c (GH-25312)

Each section is sorted to reduce diffs (review effort) when the file becomes generated.
Sort is done with key=str.lower to preserve most of the original order (underscored items first).

https://bugs.python.org/issue43795

4 years agobpo-38530: Offer suggestions on NameError (GH-25397)
Pablo Galindo [Wed, 14 Apr 2021 14:10:33 +0000 (15:10 +0100)] 
bpo-38530: Offer suggestions on NameError (GH-25397)

When printing NameError raised by the interpreter, PyErr_Display
will offer suggestions of simmilar variable names in the function that the exception
was raised from:

    >>> schwarzschild_black_hole = None
    >>> schwarschild_black_hole
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'schwarschild_black_hole' is not defined. Did you mean: schwarzschild_black_hole?

4 years agoFix typo in the What's New for 3.10 (GH-25396)
Pablo Galindo [Wed, 14 Apr 2021 13:16:47 +0000 (14:16 +0100)] 
Fix typo in the What's New for 3.10 (GH-25396)

4 years agobpo-20364: Improve sqlite3 placeholder docs (GH-25003)
Erlend Egeberg Aasland [Wed, 14 Apr 2021 12:28:55 +0000 (14:28 +0200)] 
bpo-20364: Improve sqlite3 placeholder docs (GH-25003)

4 years agobpo-43265: Improve sqlite3.Connection.backup error handling (GH-24586)
Erlend Egeberg Aasland [Wed, 14 Apr 2021 11:45:49 +0000 (13:45 +0200)] 
bpo-43265: Improve sqlite3.Connection.backup error handling (GH-24586)

4 years agobpo-43825: Fix deprecation warnings in test_cmd_line and test_collections (GH-25380)
Karthikeyan Singaravelan [Wed, 14 Apr 2021 11:45:22 +0000 (17:15 +0530)] 
bpo-43825: Fix deprecation warnings in test_cmd_line and test_collections (GH-25380)

* Fix deprecation warnings due to invalid escape sequences.
* Use self.assertEqual instead of deprecated self.assertEquals.

4 years agobpo-43752: Fix sqlite3 regression for zero-sized blobs with converters (GH-25228)
Erlend Egeberg Aasland [Wed, 14 Apr 2021 11:18:49 +0000 (13:18 +0200)] 
bpo-43752: Fix sqlite3 regression for zero-sized blobs with converters (GH-25228)

4 years agobpo-43712 : fileinput: Add encoding parameter (GH-25272)
Inada Naoki [Wed, 14 Apr 2021 05:12:58 +0000 (14:12 +0900)] 
bpo-43712 : fileinput: Add encoding parameter (GH-25272)

4 years agobpo-43777: Drop description of "pip search" command from tutorial (GH-25287)
Bob Kline [Wed, 14 Apr 2021 05:09:32 +0000 (01:09 -0400)] 
bpo-43777: Drop description of "pip search" command from tutorial (GH-25287)

4 years agobpo-38530: Offer suggestions on AttributeError (#16856)
Pablo Galindo [Wed, 14 Apr 2021 01:36:07 +0000 (02:36 +0100)] 
bpo-38530: Offer suggestions on AttributeError (#16856)

When printing AttributeError, PyErr_Display will offer suggestions of similar
attribute names in the object that the exception was raised from:

>>> collections.namedtoplo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'collections' has no attribute 'namedtoplo'. Did you mean: namedtuple?

4 years agobpo-43680: Deprecate io.OpenWrapper (GH-25357)
Victor Stinner [Wed, 14 Apr 2021 01:24:33 +0000 (03:24 +0200)] 
bpo-43680: Deprecate io.OpenWrapper (GH-25357)

Deprecate io.OpenWrapper and _pyio.OpenWrapper: use io.open and
_pyio.open instead. Until Python 3.9, _pyio.open was not a static
method and builtins.open was set to OpenWrapper to not become a bound
method when set to a class variable. _io.open is a built-in function
whereas _pyio.open is a Python function. In Python 3.10, _pyio.open()
is now a static method, and builtins.open() is now io.open().

4 years agobpo-43080: pprint for dataclass instances (GH-24389)
Lewis Gaul [Tue, 13 Apr 2021 23:59:24 +0000 (00:59 +0100)] 
bpo-43080: pprint for dataclass instances (GH-24389)

* Added pprint support for dataclass instances which don't have a custom __repr__.

4 years agobpo-43785: Update bz2 document (GH-25351)
Inada Naoki [Tue, 13 Apr 2021 23:22:49 +0000 (08:22 +0900)] 
bpo-43785: Update bz2 document (GH-25351)

4 years agobpo-43811: Test multiple OpenSSL versions on GHA (GH-25360)
Christian Heimes [Tue, 13 Apr 2021 17:23:45 +0000 (19:23 +0200)] 
bpo-43811: Test multiple OpenSSL versions on GHA (GH-25360)

The new checks are only executed when one or more OpenSSL-related files are modified. The checks run a handful of networking and hashing test suites. All SSL checks are optional. This PR also introduces ccache to speed up compilation. In common cases it speeds up configure and compile time from about 90 seconds to less than 30 seconds.

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-43797: Handle correctly invalid assignments inside function calls and generators...
Pablo Galindo [Tue, 13 Apr 2021 16:51:21 +0000 (17:51 +0100)] 
bpo-43797: Handle correctly invalid assignments inside function calls and generators (GH-25390)

4 years agoDoc: Try to enhance wording on circular imports. (GH-24705)
Julien Palard [Tue, 13 Apr 2021 16:03:22 +0000 (18:03 +0200)] 
Doc: Try to enhance wording on circular imports. (GH-24705)

4 years agobpo41515: Fix assert in test which throws SyntaxWarning. (#25379)
Karthikeyan Singaravelan [Tue, 13 Apr 2021 13:54:23 +0000 (19:24 +0530)] 
bpo41515: Fix assert in test which throws SyntaxWarning. (#25379)

4 years agobpo-43770: Cleanup type_ready() (GH-25388)
Victor Stinner [Tue, 13 Apr 2021 13:25:16 +0000 (15:25 +0200)] 
bpo-43770: Cleanup type_ready() (GH-25388)

* Rename functions
* Only pass type parameter to "add_xxx" functions.
* Clarify the role of the type_ready_inherit_as_structs() function.
* Move type_dict_set_doc() code to call it in type_ready_fill_dict().

4 years agobpo-43770: Reorder type_ready() (GH-25373)
Victor Stinner [Tue, 13 Apr 2021 11:33:31 +0000 (13:33 +0200)] 
bpo-43770: Reorder type_ready() (GH-25373)

Add type_ready_create_dict() sub-function.

* Start with type_ready_create_dict().
* Call type_ready_mro() earlier, before type_ready_add_attrs().
* Call type_ready_inherit_special() earlier, in type_ready_inherit().

4 years agobpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365)
Andrew V. Jones [Tue, 13 Apr 2021 11:27:21 +0000 (12:27 +0100)] 
bpo-43816: Add extern "C" to Include/cpython/pyctype.h (GH-25365)

Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
4 years agobpo-43760: Speed up check for tracing in interpreter dispatch (#25276)
Mark Shannon [Tue, 13 Apr 2021 10:08:14 +0000 (11:08 +0100)] 
bpo-43760: Speed up check for tracing in interpreter dispatch (#25276)

* Remove redundant tracing_possible field from interpreter state.

* Move 'use_tracing' from tstate onto C stack, for fastest possible checking in dispatch logic.

* Add comments stressing the importance stack discipline when dealing with CFrames.

* Add NEWS

4 years agobpo-43731: Add an `encoding` parameter to logging.fileConfig() (GH-25273)
Inada Naoki [Tue, 13 Apr 2021 09:17:03 +0000 (18:17 +0900)] 
bpo-43731: Add an `encoding` parameter to logging.fileConfig() (GH-25273)

4 years agobpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329)
Christian Heimes [Tue, 13 Apr 2021 06:17:26 +0000 (08:17 +0200)] 
bpo-43799: OpenSSL 3.0.0: declare OPENSSL_API_COMPAT 1.1.1 (GH-25329)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-43787: Add __iter__ to GzipFile, BZ2File, and LZMAFile (GH-25353)
Inada Naoki [Tue, 13 Apr 2021 04:51:49 +0000 (13:51 +0900)] 
bpo-43787: Add __iter__ to GzipFile, BZ2File, and LZMAFile (GH-25353)

4 years agoEnsure that early = are not matched by the parser as invalid comparisons (GH-25375)
Pablo Galindo [Tue, 13 Apr 2021 01:32:33 +0000 (02:32 +0100)] 
Ensure that early = are not matched by the parser as invalid comparisons (GH-25375)

4 years agoRemove an unnecessary copy of the 'namespace' parameter to make_dataclass(). (GH...
Eric V. Smith [Tue, 13 Apr 2021 01:02:02 +0000 (21:02 -0400)] 
Remove an unnecessary copy of the 'namespace' parameter to make_dataclass(). (GH-25372)

4 years agobpo-43774: Add more links to configure options (GH-25363)
Victor Stinner [Mon, 12 Apr 2021 21:27:35 +0000 (23:27 +0200)] 
bpo-43774: Add more links to configure options (GH-25363)

4 years agoFix Sphinx errors in the documentation and re-activate the suspicious check (GH-25368)
Pablo Galindo [Mon, 12 Apr 2021 19:53:15 +0000 (20:53 +0100)] 
Fix Sphinx errors in the documentation and re-activate the suspicious check (GH-25368)

The suspicious check is still executed as part of the release process and release managers have been
lately fixing some actual errors that the suspicious target can find. For this reason, reactivate the suspicious
until we decide what to do in a coordinated fashion.

4 years agobpo-41515: Fix KeyError raised in get_type_hints (GH-25352)
Karthikeyan Singaravelan [Mon, 12 Apr 2021 18:17:25 +0000 (23:47 +0530)] 
bpo-41515: Fix KeyError raised in get_type_hints (GH-25352)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: efahl <36704995+efahl@users.noreply.github.com>
4 years agobpo-42904: Fix get_type_hints for class local namespaces (GH-24201)
Ken Jin [Mon, 12 Apr 2021 17:23:12 +0000 (01:23 +0800)] 
bpo-42904: Fix get_type_hints for class local namespaces (GH-24201)

4 years agoUse double quotes over single quotes for match statement grammar (GH-24943)
Ken Jin [Mon, 12 Apr 2021 17:03:20 +0000 (01:03 +0800)] 
Use double quotes over single quotes for match statement grammar (GH-24943)

4 years agobpo-43797: Improve syntax error for invalid comparisons (#25317)
Pablo Galindo [Mon, 12 Apr 2021 15:59:30 +0000 (16:59 +0100)] 
bpo-43797: Improve syntax error for invalid comparisons (#25317)

* bpo-43797: Improve syntax error for invalid comparisons

* Update Lib/test/test_fstring.py

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* Apply review comments

* can't -> cannot

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
4 years agobpo-43774: Remove --without-cycle-gc doc (GH-25364)
Victor Stinner [Mon, 12 Apr 2021 15:58:45 +0000 (17:58 +0200)] 
bpo-43774: Remove --without-cycle-gc doc (GH-25364)

The configure --without-cycle-gc option has been removed in Python
2.3 by the commit cccd1e72481106b0a373117f32fda6261f3141a7. It's now
time to remove the last reference to it in the documentation.

4 years agobpo-42248: [Enum] ensure exceptions raised in ``_missing_`` are released (GH-25350)
Ethan Furman [Mon, 12 Apr 2021 15:51:20 +0000 (08:51 -0700)] 
bpo-42248: [Enum] ensure exceptions raised in ``_missing_`` are released (GH-25350)

4 years agobpo-41661: Document os.path.relpath() exception on Windows with different drives...
Zackery Spytz [Mon, 12 Apr 2021 15:39:31 +0000 (09:39 -0600)] 
bpo-41661: Document os.path.relpath() exception on Windows with different drives (GH-25346)

4 years agobpo-34311: Add locale.localize (GH-15275)
Cédric Krier [Mon, 12 Apr 2021 12:17:40 +0000 (14:17 +0200)] 
bpo-34311: Add locale.localize (GH-15275)

* Add method localize to the locale module
* Update the documentation of the locale module

4 years agobpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361)
Christian Heimes [Mon, 12 Apr 2021 11:12:36 +0000 (13:12 +0200)] 
bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361)

4 years agobpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355)
Christian Heimes [Mon, 12 Apr 2021 10:00:38 +0000 (12:00 +0200)] 
bpo-41561: Fix testing with OpenSSL 1.0.2 (GH-25355)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agotry and get a peak at mock-related PRs before they land (#25356)
Chris Withers [Mon, 12 Apr 2021 09:44:42 +0000 (10:44 +0100)] 
try and get a peak at mock-related PRs before they land (#25356)

4 years agobpo-43680: _pyio.open() becomes a static method (GH-25354)
Victor Stinner [Mon, 12 Apr 2021 08:44:53 +0000 (10:44 +0200)] 
bpo-43680: _pyio.open() becomes a static method (GH-25354)

The Python _pyio.open() function becomes a static method to behave as
io.open() built-in function: don't become a bound method when stored
as a class variable. It becomes possible since static methods are now
callable in Python 3.10. Moreover, _pyio.OpenWrapper becomes a simple
alias to _pyio.open.

init_set_builtins_open() now sets builtins.open to io.open, rather
than setting it to io.OpenWrapper, since OpenWrapper is now an alias
to open in the io and _pyio modules.

4 years agobpo-43723: Deprecate camelCase aliases from threading (GH-25174)
Jelle Zijlstra [Mon, 12 Apr 2021 08:42:53 +0000 (01:42 -0700)] 
bpo-43723: Deprecate camelCase aliases from threading (GH-25174)

The snake_case names have existed since Python 2.6, so there is
no reason to keep the old camelCase names around. One similar
method, threading.Thread.isAlive, was already removed in
Python 3.9 (bpo-37804).

4 years agobpo-43785: Improve BZ2File performance by removing RLock (GH-25299)
Inada Naoki [Mon, 12 Apr 2021 05:46:53 +0000 (14:46 +0900)] 
bpo-43785: Improve BZ2File performance by removing RLock (GH-25299)

Remove `RLock` from `BZ2File`. It makes `BZ2File` to thread unsafe, but
gzip and lzma don't use it too.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
4 years agobpo-43682: Make staticmethod objects callable (GH-25117)
Victor Stinner [Sun, 11 Apr 2021 22:21:22 +0000 (00:21 +0200)] 
bpo-43682: Make staticmethod objects callable (GH-25117)

Static methods (@staticmethod) are now callable as regular functions.

4 years agobpo-43770: Refactor PyType_Ready() function (GH-25336)
Victor Stinner [Sun, 11 Apr 2021 21:57:09 +0000 (23:57 +0200)] 
bpo-43770: Refactor PyType_Ready() function (GH-25336)

* Split PyType_Ready() into sub-functions.
* type_ready_mro() now checks if bases are static types earlier.
* Check tp_name earlier, in type_ready_checks().
* Add _PyType_IsReady() macro to check if a type is ready.

4 years agobpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (#24818)
Ken Jin [Sun, 11 Apr 2021 13:26:09 +0000 (21:26 +0800)] 
bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (#24818)

* coerce bytes separator to string

* Add news

* Update Misc/NEWS.d/next/Library/2021-03-11-00-31-41.bpo-42967.2PeQRw.rst

4 years agoFix typo in 3.10.0a7.rst (GH-25340)
Sergey B Kirpichev [Sun, 11 Apr 2021 08:50:42 +0000 (11:50 +0300)] 
Fix typo in 3.10.0a7.rst (GH-25340)

4 years agoFix description of behaviour of an exception class in 'from' clause (GH-24303)
Mark Dickinson [Sun, 11 Apr 2021 08:33:59 +0000 (09:33 +0100)] 
Fix description of behaviour of an exception class in 'from' clause (GH-24303)

4 years agobpo-43751: Fix anext() bug where it erroneously returned None (GH-25238)
Dennis Sweeney [Sun, 11 Apr 2021 04:51:35 +0000 (00:51 -0400)] 
bpo-43751: Fix anext() bug where it erroneously returned None (GH-25238)

4 years agobpo-43772: Fix TypeVar.__ror__ (GH-25339)
Jelle Zijlstra [Sun, 11 Apr 2021 03:00:05 +0000 (20:00 -0700)] 
bpo-43772: Fix TypeVar.__ror__ (GH-25339)

4 years agobpo-43783: Add ParamSpecArgs/Kwargs (GH-25298)
Jelle Zijlstra [Sun, 11 Apr 2021 02:57:05 +0000 (19:57 -0700)] 
bpo-43783: Add ParamSpecArgs/Kwargs (GH-25298)

4 years agobpo-43764: Add match_args=False parameter to dataclass decorator and to make_dataclas...
Eric V. Smith [Sun, 11 Apr 2021 01:28:42 +0000 (21:28 -0400)] 
bpo-43764: Add match_args=False parameter to dataclass decorator and to make_dataclasses function. (GH-25337)

Add match_args=False parameter to dataclass decorator and to make_dataclass function.

4 years agoFix typo about line number in the 3.10 What's New document (GH-25328)
Antti Haapala [Sun, 11 Apr 2021 00:20:41 +0000 (03:20 +0300)] 
Fix typo about line number in the 3.10 What's New document (GH-25328)

This was a typo copied from PEP 626.

4 years agobpo-41974: Remove part of the note regarding complex.__float__ (GH-25197)
DevilXD [Sat, 10 Apr 2021 22:36:40 +0000 (00:36 +0200)] 
bpo-41974: Remove part of the note regarding complex.__float__ (GH-25197)

(The deleted example no longer works and is thus irrelevant.)

4 years agobpo-43753: Add Py_Is() and Py_IsNone() functions (GH-25227)
Victor Stinner [Sat, 10 Apr 2021 22:17:39 +0000 (00:17 +0200)] 
bpo-43753: Add Py_Is() and Py_IsNone() functions (GH-25227)

Add the Py_Is(x, y) function to test if the 'x' object is the 'y'
object, the same as "x is y" in Python. Add also the Py_IsNone(),
Py_IsTrue(), Py_IsFalse() functions to test if an object is,
respectively, the None singleton, the True singleton or the False
singleton.

4 years agobpo-43478: Fix formatting of NEWS entry (GH-25335)
Pablo Galindo [Sat, 10 Apr 2021 21:19:02 +0000 (22:19 +0100)] 
bpo-43478: Fix formatting of NEWS entry (GH-25335)

4 years agobpo-43770: Refactor type_new() function (GH-25325)
Victor Stinner [Sat, 10 Apr 2021 21:15:32 +0000 (23:15 +0200)] 
bpo-43770: Refactor type_new() function (GH-25325)

* Split type_new() into into many small functions.
* Add type_new_ctx structure to pass variables between subfunctions.
* Initialize some PyTypeObject and PyHeapTypeObject members earlier
  in type_new_alloc().
* Rename variables to more specific names.
* Add "__weakref__" identifier for type_new_visit_slots().
* Factorize code to convert a method to a classmethod
  (__init_subclass__ and __class_getitem__).
* Add braces to respect PEP 7.
* Move variable declarations where the variables are initialized.

4 years agobpo-43798: Add source location attributes to alias (GH-25324)
Matthew Suozzo [Sat, 10 Apr 2021 20:56:28 +0000 (16:56 -0400)] 
bpo-43798: Add source location attributes to alias (GH-25324)

* Add source location attributes to alias.
* Move alias star construction to pegen helper.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
4 years agobpo-40701: doc typo historcal -> historical (GH-25334)
Gregory P. Smith [Sat, 10 Apr 2021 17:55:14 +0000 (10:55 -0700)] 
bpo-40701: doc typo historcal -> historical (GH-25334)

4 years agobpo-43739: Add type declaration Doc/extending/extending.rst example
Shreyan Avigyan [Sat, 10 Apr 2021 15:54:32 +0000 (21:24 +0530)] 
bpo-43739: Add type declaration Doc/extending/extending.rst example

4 years agobpo-43478: Restrict use of Mock objects as specs (GH-25326)
Matthew Suozzo [Sat, 10 Apr 2021 03:45:50 +0000 (23:45 -0400)] 
bpo-43478: Restrict use of Mock objects as specs (GH-25326)

* Restrict using Mock objects as specs as this is always a test bug where the resulting mock is misleadingly useless.
* Skip a broken test that exposes a bug elsewhere in mock (noted in the original issue).

4 years agobpo-39899: Don't double-check directory name if we're requesting the current user...
Barney Gale [Fri, 9 Apr 2021 21:28:15 +0000 (22:28 +0100)] 
bpo-39899: Don't double-check directory name if we're requesting the current user's home directory in ntpath.expanduser() (GH-25277)

4 years agobpo-40107: Switch to using io.open() for pathlib.Path.open() (GH-25240)
Barney Gale [Fri, 9 Apr 2021 20:52:49 +0000 (21:52 +0100)] 
bpo-40107: Switch to using io.open() for pathlib.Path.open() (GH-25240)

Previously we had identical behaviour but only allowed accessors to override os.open(). This change allows the override to also construct the IO wrapper as well.

4 years agobpo-38820: OpenSSL 3.0.0: Use supported hashing algos in doc test (GH-25319)
Christian Heimes [Fri, 9 Apr 2021 20:23:10 +0000 (22:23 +0200)] 
bpo-38820: OpenSSL 3.0.0: Use supported hashing algos in doc test (GH-25319)

ripemd160 is not available in OpenSSL 3.0.0's default crypto provider.
It's only present in legacy provider.

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-43794: OpenSSL 3.0.0: set OP_IGNORE_UNEXPECTED_EOF by default (GH-25309)
Christian Heimes [Fri, 9 Apr 2021 15:59:21 +0000 (17:59 +0200)] 
bpo-43794: OpenSSL 3.0.0: set OP_IGNORE_UNEXPECTED_EOF by default (GH-25309)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-43682: @staticmethod inherits attributes (GH-25268)
Victor Stinner [Fri, 9 Apr 2021 15:51:22 +0000 (17:51 +0200)] 
bpo-43682: @staticmethod inherits attributes (GH-25268)

Static methods (@staticmethod) and class methods (@classmethod) now
inherit the method attributes (__module__, __name__, __qualname__,
__doc__, __annotations__) and have a new __wrapped__ attribute.

Changes:

* Add a repr() method to staticmethod and classmethod types.
* Add tests on the @classmethod decorator.

4 years agobpo-43788: Generate version specific _ssl_data.h (GH-25300)
Christian Heimes [Fri, 9 Apr 2021 15:02:00 +0000 (17:02 +0200)] 
bpo-43788: Generate version specific _ssl_data.h (GH-25300)

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: GH:tiran
4 years agobpo-4379: Skip TLS 1.0/1.1 tests under OpenSSL 3.0.0 (GH-25304)
Christian Heimes [Fri, 9 Apr 2021 13:43:06 +0000 (15:43 +0200)] 
bpo-4379: Skip TLS 1.0/1.1 tests under OpenSSL 3.0.0 (GH-25304)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agobpo-43789: OpenSSL 3.0.0 Don't call passwd callback again in error case (GH-25303)
Christian Heimes [Fri, 9 Apr 2021 13:23:38 +0000 (15:23 +0200)] 
bpo-43789: OpenSSL 3.0.0 Don't call passwd callback again in error case (GH-25303)

4 years agobpo-43774: Document the Python Build System (GH-25302)
Victor Stinner [Fri, 9 Apr 2021 12:35:10 +0000 (14:35 +0200)] 
bpo-43774: Document the Python Build System (GH-25302)

* Elaborate PGO and LTO documentaton.
* Document MAINCC, PURIFY and LINKCC variables.

4 years agobpo-43774: Doc job of Azure Pipelines uses Doc/requirements.txt (GH-25296)
Victor Stinner [Fri, 9 Apr 2021 10:36:47 +0000 (12:36 +0200)] 
bpo-43774: Doc job of Azure Pipelines uses Doc/requirements.txt (GH-25296)

Don't hardcode the Sphinx version but use Doc/requirements.txt.

4 years agoSimplify _PyPegen_fill_token in pegen.c (GH-25295)
Pablo Galindo [Fri, 9 Apr 2021 00:32:25 +0000 (01:32 +0100)] 
Simplify _PyPegen_fill_token in pegen.c (GH-25295)

4 years agoSanitize macros and debug functions in pegen.c (GH-25291)
Pablo Galindo [Fri, 9 Apr 2021 00:17:31 +0000 (01:17 +0100)] 
Sanitize macros and debug functions in pegen.c (GH-25291)

4 years agobpo-43774: Enhance configure documentation (GH-25293)
Victor Stinner [Thu, 8 Apr 2021 23:58:20 +0000 (01:58 +0200)] 
bpo-43774: Enhance configure documentation (GH-25293)

4 years agoBreak down some complex functions in pegen.c for readability (GH-25292)
Pablo Galindo [Thu, 8 Apr 2021 23:48:53 +0000 (00:48 +0100)] 
Break down some complex functions in pegen.c for readability (GH-25292)

4 years agoFix possible refleak involving _PyArena_AddPyObject (GH-25289)
Erlend Egeberg Aasland [Thu, 8 Apr 2021 23:05:44 +0000 (01:05 +0200)] 
Fix possible refleak involving _PyArena_AddPyObject (GH-25289)

4 years agobpo-39702: Remove dotted_name from decorator documentation (GH-25234)
Saiyang Gou [Thu, 8 Apr 2021 22:34:09 +0000 (15:34 -0700)] 
bpo-39702: Remove dotted_name from decorator documentation (GH-25234)

4 years agobpo-43778: Fix Sphinx glossary_search extension (GH-25286)
Victor Stinner [Thu, 8 Apr 2021 22:07:01 +0000 (00:07 +0200)] 
bpo-43778: Fix Sphinx glossary_search extension (GH-25286)

Create the _static/ directory if it doesn't exist.

Add also constants for the static directory and the JSON filename.

4 years agobpo-43774: Document configure options (GH-25283)
Victor Stinner [Thu, 8 Apr 2021 20:32:21 +0000 (22:32 +0200)] 
bpo-43774: Document configure options (GH-25283)

Add Doc/using/configure.rst documentation to document configure,
preprocessor, compiler and linker options.

Add a new section about the "Python debug build".

4 years agobpo-43764: Fix `__match_args__` generation logic for dataclasses (GH-25284)
Brandt Bucher [Thu, 8 Apr 2021 19:54:34 +0000 (12:54 -0700)] 
bpo-43764: Fix `__match_args__` generation logic for dataclasses (GH-25284)

4 years agobpo-43760: Streamline dispatch sequence for machines without computed gotos. (GH...
Mark Shannon [Thu, 8 Apr 2021 10:22:55 +0000 (11:22 +0100)] 
bpo-43760: Streamline dispatch sequence for machines without computed gotos. (GH-25244)

* Do fetch and decode at end of opcode then jump directly to switch.
  Should allow compilers that don't support computed-gotos, specifically MSVC,
  to generate better code.

4 years agobpo-43770: _PyTypes_Init() inits _PyAnextAwaitable_Type (GH-25266)
Victor Stinner [Thu, 8 Apr 2021 07:58:15 +0000 (09:58 +0200)] 
bpo-43770: _PyTypes_Init() inits _PyAnextAwaitable_Type (GH-25266)

* Rename PyAnextAwaitable_Type to _PyAnextAwaitable_Type.
* Expose the type in the internal C API.

4 years agoFix broken test for MutableSet.pop() (GH-25209)
Stepan Sindelar [Wed, 7 Apr 2021 23:31:55 +0000 (01:31 +0200)] 
Fix broken test for MutableSet.pop() (GH-25209)

Changes the test to not assert concrete result of pop, but just that it
was an item from the set, and that the set shrunk by one.

4 years agobpo-39899: os.path.expanduser(): don't guess other Windows users' home directories...
Barney Gale [Wed, 7 Apr 2021 22:50:13 +0000 (23:50 +0100)] 
bpo-39899: os.path.expanduser(): don't guess other Windows users' home directories if the basename of the current user's home directory doesn't match their username. (GH-18841)

This makes `ntpath.expanduser()` match `pathlib.Path.expanduser()` in this regard, and is more in line with `posixpath.expanduser()`'s cautious approach.

Also remove the near-duplicate implementation of `expanduser()` in pathlib, and by doing so fix a bug where KeyError could be raised when expanding another user's home directory.

4 years agobpo-43770: _PyTypes_Init() inits more static types (GH-25265)
Victor Stinner [Wed, 7 Apr 2021 22:47:55 +0000 (00:47 +0200)] 
bpo-43770: _PyTypes_Init() inits more static types (GH-25265)