A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-October/113905.html below:

[Python-Dev] check for PyUnicode_READY look backwards

[Python-Dev] check for PyUnicode_READY look backwardsNick Coghlan ncoghlan at gmail.com
Thu Oct 6 19:55:47 CEST 2011
On Thu, Oct 6, 2011 at 10:31 AM, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
> On 6 Oct, 2011, at 14:57, Amaury Forgeot d'Arc wrote:
>> I'd prefer it was written :
>>       if (PyUnicode_READY(*filename) < 0)
>> because "< 0" clearly indicates an error condition.
>> That's how all calls to PyType_Ready are written, for example.
>>
>> Am I the only one to be distracted by this idiom?
>
> I prefer the '< 0' variant as well, for the same reason as you.

+1 here as well.

The Unix/C "0 as success" idiom breaks my Python conditioned brain, so
including the explicit "< 0" in the C code helps resolve that
impedance mismatch.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4