Why '==' ??

Tim Roberts timr at probo.com
Fri Apr 2 20:14:23 EST 2004


Vrai Stacey <spam.trap.vrai.stacey at spam.trap.kbcfp.com> wrote:
>
>I would assume it's because most people come to Python having programmed 
>other languages. In most other languages (excepting stuff like 
>Pascal/Modula-2/etc ...) '=' is used for assignment and '==' for 
>equality.

Interesting you would put it that way.  I would have guessed that "most"
was not accurate.  "In the languages most programmers use", yes, but not
"In most other languages".

C, C++, Java, C#, and Javascript all use = for assignment, == for
compare-equal.

Basic, VBScript, Cobol and SQL use = for both.

Pascal, Modula-X, Algol, Ada, Oberon, and Eiffel use := for assignment, =
for compare-equal.

Fortran uses = for assignment and .EQ. for compare-equal.

APL uses squiggle quad bang hack splat over splat dot splat.

LISP uses -- well, no one really knows what the actual syntax is for LISP.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list