Pre-PEP: Unpacking in Comprehensions

Thanks for all the input so far! I’ve made a few changes since posting this, which I wanted to call out here as a little bit of a progress update. Here are fresh links to the current version of everything:

Here’s a brief list of the changes I’ve made since my original post:

  • Rewrote and reorganized big chunks of PEP itself (current rendered version, diff)
    • Added some responses from this conversation (note that “Rejected” is maybe too strong a word for this point in the process)
    • Added examples from the standard library
  • Updated the reference implementation:
    • Made a first pass at documentation for the proposed changes (diff)
    • Added/changed some test cases (diff 1, diff 2)
    • Fixed some issues with the grammar in my original implementation to make sure that existing tests were all passing (diff)
    • Added some new specific error messages for malformed comprehensions (diff)
    • Fixed an error with how async comprehensions where being handled (thanks to one of the test files in @alexprengere’s draft implementation) (diff)
3 Likes