On 6/26/2016 8:41 AM, MRAB wrote:
On 2016-06-26 11:48, BartC wrote:
On 26/06/2016 08:36, Lawrence D’Oliveiro wrote:
One of Python’s few mistakes was that it copied the C convention of
using “=” for assignment and “==” for equality comparison.
One of C's many mistakes. Unfortunately C has been very influential.
However, why couldn't Python have used "=" both for assignment, and for
equality? Since I understand assignment ops can't appear in expressions.
[snip]
Python supports chained assignments. For example, "a = b = 0" assigns
0 to both a and b.
I'm not sure how common it is, though. I virtually never use it myself.
How can you not use chained assignments? I thought Python was the art of
the clever one-liners. :)
Chris R.
--
https://mail.python.org/mailman/listinfo/python-list