[Python-ideas] PEP 572: Assignment Expressions (post #4)
MRAB
python at mrabarnett.plus.com
Fri Apr 13 13:37:22 EDT 2018
On 2018-04-13 16:13, Guido van Rossum wrote:
> Regarding the precedence of :=, at this point the only acceptable
> outcome for me is one where at the statement level, := and = can be used
> interchangeably and will have the same meaning (except probably we
> wouldn't allow combining both in a chained assignment). Because then we
> can say "and you can use assignment in expressions too, except there you
> must use := because = would be too easily confused with ==".
>
> Ideally this would allow all forms of = to be replaced with :=, even
> extended structure unpacking (a, b, *c := foo()).
>
+1
It would be confusing to have 2 forms of assignment which look alike but
with different precedences.
More information about the Python-ideas
mailing list