seeking deeper (language theory) reason behind Python design choice

Marko Rauhamaa marko at pacujo.net
Sat May 19 04:38:09 EDT 2018


"Peter J. Holzer" <hjp-python at hjp.at>:
> (I wonder whether the notion that “=” and “==” are easy to mix up
> stems from the early days of C when C was an outlier (most other
> languages at the time used “=” for equality). Now C is mainstream and
> it's those other languages that seem odd.)

I occasionally mix them up one way or another, whether by typing them
wrong accidentally or through some copy-and-paste mishap. Typos of all
kind happen all the time, but the "="/"==" mixup isn't easy for the eye
to spot and it doesn't create a syntax error.

A famous example:

   +       if ((options == (__WCLONE|__WALL)) && (current->uid = 0))
   +                       retval = -EINVAL;

   <URL: https://lwn.net/Articles/57135/>


Marko



More information about the Python-list mailing list