[Chris Angelico <rosuav@gmail.com>]
> ...
> Not qualitative, but anecdotal: I do sometimes have to remind my
> JavaScript students to check whether they've typed enough equals
> signs. And that's in a language where the normal comparison operator
> is ===. It's *still* not uncommon to see a comparison spelled =.
I wonder whether Guido remembers this ;-) In the very, very, VERY
early days, Python didn't have "==". Plain single "=" was used for
both assignment and equality testing. So way back then. using "=" for
embedded assignment too was intractable on the face of it.
I'm not clear on why it changed. I remember writing to Guido about
how to disambiguate between the "bind" and "test for equality" intents
in isolated expressions typed at the interactive prompt, and next
thing I knew the language changed to use "==" for the latter.
In any case, I really don't want to see plain "=" for embedded
assignments now.
[...]
I'm fond enough of ":=". Icon used that for assignment (embedded or
otherwise), and I don't recall any bugs due to that. It was hard to
confuse for "==" (whether conceptual confusion or visual confusion).
That was just prone to the _other_ problem with embedded assignments:
staring and staring trying to find the code where a name was most
recently bound - "oh! it was bound inside the third nested clause in
the `while` test two pages back". So it would be nice to combine
embedded assignment with some notion of limited scope - but I'm much
more concerned that the spelling not be easily confusable with "==".
But not really a fan of overly wordy spellings either.
There you go! All the rest follows trivially from the Zen of Python ;-)