[Python-ideas] Augmented assignment syntax for objects.
Random832
random832 at fastmail.com
Fri Apr 28 03:02:24 EDT 2017
On Fri, Apr 28, 2017, at 01:30, Chris Angelico wrote:
> Nothing whatsoever says that this is a good idea, but it's perfectly
> legal, because the for loop is defined in terms of assignment. If this
> were to be accepted (which, fwiw, I'm not actually advocating, but
> IF), it would also be defined in terms of assignment. You still
> shouldn't be assigning to arbitrary objects, especially not randomly
> rebinding module names, but it's easy to grok the assignment
> equivalence.
What's not clear is when the left side (an object whose attribute/item
is being assigned, and the item index) is evaluated, and why this should
be different from when default arguments are evaluated.
More information about the Python-ideas
mailing list