Looks similar to the zip(*[iter(s)]*n, strict=True) idiom. I don’t think I’ve ever seen complaints about that, and it’s suggested by the doc.
Feel free to comment on the issue that I created. Let’s not derail this discussion ![]()
Sorry for a little bit of a delay here! I went ahead and made some changes to the draft (a little bit of copyediting and reordering, plus adding a section discussing other languages, mostly from copy-pasting from my earlier post). Here are links to the current state of things (I didn’t make any changes to the reference implementation, but I’m including it here again anyway):
- Draft PEP: rendered, source repo
- Reference Implementation: Emscripten demo, source repo, diff against main repo
Feedback/suggestions/questions/comments/thoughts are, of course, welcome!
I started leaving a couple of comments in the individual commits of your branch, but perhaps this process would be easier if a proper (draft?) PR was created
(otherwise I need to git-blame the changes from the main diff to retrieve each commit).
I’m not sure the best way to do this since I don’t think this is ready to actually put in even a draft PR against the main repo. For now, I went ahead and made PR’s against my own copy of the repo; maybe that works?
The draft PEP has been published: https://peps.python.org/pep-0798/
And can be discussed at: PEP 798: Unpacking in Comprehensions.