On 15/05/2018 21:21, Peter J. Holzer wrote:

I have been programming in C since the mid-80's and in Perl since the
mid-90's (both languages allow assignment expressions). I accumulated my
fair share of bugs in that time, but AFAIR I made this particular error
very rarely (I cannot confidently claim that I never made it). Clearly
it is not “a total bug magnet” in my experience. There are much bigger
problems in C and Perl (and Python, too). But of course my experience is

All those languages use = for assignment and == for equality.

If like me you normally use a language where = means equality (and := is used for assignment), then you're going to get it wrong more frequently when using C or Python (I don't use Perl).

You might get it wrong anyway because = is used for equality in the real world too.

And it's an error that is awkward to detect (in C anyway, as it would be an error in Python) because usually both = and == are plausible in an expression.

--
bartc
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to