[Edu-sig] Equality and Assignment Notation
Dustin Mitchell
dustin@ywlcs.org
Sun, 7 Apr 2002 12:14:29 -0500
On Sun, Apr 07, 2002 at 05:04:19PM +0000, Josh McKenzie wrote:
> It may seem a trivial point to bring up, but while I can explain the
> difference between equality and assignment, I cannot explain the
> logic of using the '=' and '==' notation.
I assume that Python inherited this behavior from C/C++ or some other
languages, as you indicated. The only language I can think of where there
was an independent justification for the syntax was BASIC, where one could
write:
10 LET X = 20
which takes its cue from mathematical prose. The LET was optional, so this
was universally shortened to
10 X = 20
and the confusion began.
That's my theory.
Dustin
--
Dustin Mitchell
dustin@ywlcs.org
http://people.cs.uchicago.edu/~dustin/