This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: enumerate no longer accepts iterable keyword argument
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: JelleZijlstra, corona10, rhettinger, trey
Priority: release blocker Keywords: patch

Created on 2022-01-26 01:14 by trey, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30904 merged JelleZijlstra, 2022-01-26 03:39
Messages (4)
msg411695 - (view) Author: Trey Hunner (trey) * Date: 2022-01-26 01:14
While playing around with the main CPython branch against I noticed that enumerate now gives a strange error message when `iterable` is provided as a keyword argument:

>>> enumerate(iterable=[])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: enumerate() missing required argument 'iterable'

When passing an invalid keyword argument (and no positional arguments) an interesting error message is also given:

>>> enumerate(hello="world")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: enumerate() missing required argument 'iterable'


The help output still shows that iterable is accepted as either a keyword argument or a positional argument.
msg411702 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2022-01-26 03:18
I can confirm that the behavior changed between 3.10 and current main: enumerate(iterable=[]) works on 3.10 but not on main. It's likely a consequence of bpo-43706.

I'll submit a patch to restore the previous behavior.
msg411760 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2022-01-26 15:46
New changeset ac0c6e128cb6553585af096c851c488b53a6c952 by Jelle Zijlstra in branch 'main':
bpo-46527: allow calling enumerate(iterable=...) again (GH-30904)
https://github.com/python/cpython/commit/ac0c6e128cb6553585af096c851c488b53a6c952
msg411761 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2022-01-26 15:47
So since no more regression is expected, I would like to propose merging the PR and once we need to change the implementation, we can revert Vectorcall anytime, Rollbacking Vectorcall will not raise any behavior regression so anytime we can rollback it.
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90685
2022-01-26 15:47:40corona10setstatus: open -> closed
resolution: fixed
messages: + msg411761

stage: patch review -> resolved
2022-01-26 15:46:56corona10setmessages: + msg411760
2022-01-26 06:09:20corona10setpriority: normal -> release blocker
2022-01-26 04:51:14rhettingersetnosy: + rhettinger
2022-01-26 03:39:17JelleZijlstrasetkeywords: + patch
stage: patch review
pull_requests: + pull_request29082
2022-01-26 03:18:41JelleZijlstrasetnosy: + corona10, JelleZijlstra
messages: + msg411702
2022-01-26 01:14:56treycreate