On 2018-05-19 11:38:09 +0300, Marko Rauhamaa wrote: > "Peter J. Holzer" <hjp-pyt...@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;
It's famous, but it is also a bad example: 1) It wasn't an accident, it was deliberate. 2) It was spotted. hp -- _ | Peter J. Holzer | we build much bigger, better disasters now |_|_) | | because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
signature.asc
Description: PGP signature
-- https://mail.python.org/mailman/listinfo/python-list