[Python-Dev] PEP 572: Assignment Expressions
Tim Peters
tim.peters at gmail.com
Tue Apr 24 13:01:18 EDT 2018
[Chris Angelico <rosuav at gmail.com>]
> Hopefully you have seen, or soon will see, the latest posting of the
> PEP, in which assignment targets are restricted to simple names. :)
I haven't yet, but look forward to it! You have the patience of a
saint to endure all this - I would have given up 6 years ago ;-)
> Though I still talk about "assignment expressions". I don't see a
> problem with calling them that, but I also don't see a problem with
> calling them "binding expressions" if you prefer.
It's psychology ;-) So long as the PEP calls them assignment
expressions, people are going to imagine facing the horrors of things
like the current
*b, c = a[c] = a
assignment statement buried deep inside expressions. But in
conventional use, "binding" is restricted to identifiers, which vastly
simplifies the mental model for "the worst" that can happen.
Since fear is the most potent motivator, "don't scare people" is rule #1 ;-)
But, in the absence of Guido chiming in, it's really up to you. A few
people have expressed positive feelings about changing the name to
"binding expressions", and none opposed it (that I saw), but the
sample size is too small to claim that "proves" anything.
More information about the Python-Dev
mailing list