| You're right, this is simpler and more regular, but I don't feel that's enough of an improvement to warrant the changes required to implement it. (The C Python interpreter is not the only code that relies on understanding Python code. For example, I used to use a set of tools called "Snakefood" but they aren't currently maintained. So as Python changes and changes they become less and less useful.) In the PEP itself, under "How To Teach This" it even says, "the average Python programmer is likely unaware that the current restriction even exists." And the "good example of code ... that would become more readable, idiomatic, and maintainable if the existing restrictions were relaxed." is not a good example. IMO (as I hinted at above) it's an example of code written by a programmer who is less well-practiced than one might hope. The "Identity function hack" is part-way to the connect_button() function but it stops short at a goofy, ugly strawman function (that shadows '_'!? Why?) rather than factoring out the common parts of the expressions. Rookie mistake, eh? (The eval hack is clever but stupid.) So to me this seems like a poorly justified change that solves a non-problem. |
> In the PEP itself, under "How To Teach This" it even says, "the average Python programmer is likely unaware that the current restriction even exists."
Yup, and that's terrible. It means people are likely to trip over it.