-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
These two examples silently truncate the unmatched inputs:
>>> list(map(pow, [1, 2, 3], [2, 2, 2, 2]))
[1, 4, 9]
>>> list(map(pow, [1, 2, 3, 4, 5], [2, 2, 2, 2]))
[1, 4, 9, 16]
The current workaround is:
starmap(pow, zip(vec1, vec2, strict=True))
Ideally, map() should support this directly. The reasoning is the same reasoning that motivated the strict
option for zip()
Linked PRs
Eclips4, ethanfurman, jstasiak, nineteendo, aisk and 4 more
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement