]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-121676: Raise a ``DeprecationWarning`` if the Python implementation of ``functools...
authorKirill Podoprigora <kirill.bast9@mail.ru>
Wed, 1 Jan 2025 11:36:47 +0000 (13:36 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Jan 2025 11:36:47 +0000 (13:36 +0200)
commitd903b17499b1a3bfb3ea848f6a1b6da02eac3328
tree070a24e1cd2e3ebdb2ce6a739185f265138b244c
parentc5438fdf4706a70bdd19338edc000dacffff6837
gh-121676: Raise a ``DeprecationWarning`` if the Python implementation of ``functools.reduce`` is called with `function` or `sequence` as a keyword args (#121677)

Python implementation of `functools` allows calling `reduce`
with `function` or `sequence` as keyword args. This doesn't
match behavior of our C accelerator and our documentation
for `functools.reduce` states that `function`and `sequence`
are positional-only arguments.

Now calling a Python implementation of `functools.reduce`
with `function` or `sequence` as keyword args would raise
a `DeprecationWarning` and is planned to be prohibited in
Python 3.16.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Doc/deprecations/pending-removal-in-3.16.rst
Doc/whatsnew/3.14.rst
Lib/functools.py
Lib/test/test_functools.py
Misc/NEWS.d/next/Library/2024-07-13-13-25-31.gh-issue-121676.KDLS11.rst [new file with mode: 0644]