PEP-448: contradictory abstract

PEP 448 – Additional Unpacking Generalizations starts with the following proposition in its abstract:

This PEP proposes extended usages of the * iterable unpacking operator and ** dictionary unpacking operators to allow unpacking in more positions, an arbitrary number of times, and in additional circumstances. Specifically, in function calls, in comprehensions and generator expressions, and in displays.

This is misleading. The abstract ends with the following:

This PEP does not include unpacking operators inside list, set and dictionary comprehensions although this has not been ruled out for future proposals.

The PEP goes on to describe how the proposal of iterable unpacking in comprehensions has been tentatively rejected.

It would be nice to remove the mention of comprehensions and generator expressions from the first paragraph, so that “quick readers” aren’t mislead into believing this is actually supported.

Regardless of the contradictions, PEP 448 is, at this point, a historical document that you should not be using to learn about Python syntax. PEPs are not further maintained once accepted and implemented. You should read the Python documentation instead.


I know it’s historical - and I’m not here to learn. I’m using PEPs as a reference in a larger work that describes some of the history of Python and changes between its versions.

I wouldn’t ask for an edit to a decade old document if it wasn’t for how misleading this passage was. I was actually second-guessing my own knowledge when I read it.

PEPs are not further maintained once accepted and implemented.

Didn’t knew that. I rest my case then.

1 Like

Not quite true, clarifications are made from time to time. The rules aren’t so hard and fast as to prevent reasonable people from doing sensible things.

In this case, I think the minor clarification change makes sense, especially because the text is simple on the abstract, not the specification.

1 Like

Concretely, if this was submitted as a PR on the PEPs repo and I had the commit bit, I would accept the PR, but I would not otherwise do the work myself.

I see.