-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Closed as not planned
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
Description
Bug report
Bug description:
mapping = {
1: [101, 102, 103],
2: [201, 202, 203],
3: [301, 302, 303],
}
def iterate_generator(gen):
for pairs in gen:
print(", ".join(str(x) for x in pairs))
def iterate_packing_unpacking(*args):
for pairs in args:
print(", ".join(str(x) for x in pairs))
iterate_generator(
(((x, x_member) for x_member in x_members) for x, x_members in mapping.items())
)
# (1, 101), (1, 102), (1, 103)
# (2, 201), (2, 202), (2, 203)
# (3, 301), (3, 302), (3, 303)
iterate_packing_unpacking(
*(((x, x_member) for x_member in x_members) for x, x_members in mapping.items())
)
# (3, 101), (3, 102), (3, 103)
# (3, 201), (3, 202), (3, 203)
# (3, 301), (3, 302), (3, 303)
Expectation
The output of iterate_packing_unpacking
should be the same as iterate_generator
.
CPython versions and Operating systems tested on:
- 3.13
- Linux
- macOS
- Windows
- 3.12
- Linux
- macOS
- Windows
- 3.11
- Linux
- macOS
- Windows
- 3.10
- Linux
- macOS
- Windows
- 3.9
- Linux
- macOS
- Windows
tested on:
Linux, macOS, Windows
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)