diff options
author | Kirill Podoprigora <kirill.bast9@mail.ru> | 2025-01-01 11:36:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-01 11:36:47 (GMT) |
commit | d903b17499b1a3bfb3ea848f6a1b6da02eac3328 (patch) | |
tree | 070a24e1cd2e3ebdb2ce6a739185f265138b244c /Misc | |
parent | c5438fdf4706a70bdd19338edc000dacffff6837 (diff) | |
download | cpython-d903b17499b1a3bfb3ea848f6a1b6da02eac3328.zip cpython-d903b17499b1a3bfb3ea848f6a1b6da02eac3328.tar.gz cpython-d903b17499b1a3bfb3ea848f6a1b6da02eac3328.tar.bz2 |
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>
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2024-07-13-13-25-31.gh-issue-121676.KDLS11.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2024-07-13-13-25-31.gh-issue-121676.KDLS11.rst b/Misc/NEWS.d/next/Library/2024-07-13-13-25-31.gh-issue-121676.KDLS11.rst new file mode 100644 index 0000000..be589b7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-07-13-13-25-31.gh-issue-121676.KDLS11.rst @@ -0,0 +1,3 @@ +Deprecate calling the Python implementation of :meth:`functools.reduce` +with a ``function`` or ``sequence`` as a :term:`keyword argument`. +This will be forbidden in Python 3.16 in order to match the C implementation. |