>> Swapping the comparison order here seems a bit inconsistent to me. There are
>> lots of others around (e.g. "len == 0" in the patch context below). Why is
>> this one so special?
>>
>> I think that another developer even got told off once for these kinds of
>> comparisons.
>>
>> I hope the Clang warning is only about the parentheses.
>
> I agree with Georg: "if ('u' == typecode)" is not well readable,
> since you usually put the variable part on the left and the constant
> part on the right of an equal comparison.
>
> If clang warns about this, clang needs to be fixed, not our
> C code :-)
>

+1

Placing the constant first in a comparison is a fundamental style
issue. Personally I also don't like doing that, but whatever way is
chosen must be consistent. It's definitely wrong to change this in a
single place. We have PEP-7 for these things!

AFAIK, Clang doesn't produce a warning for this, at least without
special static-analysis warning levels.

Eli
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to