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/113878.html below:

[Python-Dev] check for PyUnicode_READY look backwards

[Python-Dev] check for PyUnicode_READY look backwards [Python-Dev] check for PyUnicode_READY look backwardsAmaury Forgeot d'Arc amauryfa at gmail.com
Thu Oct 6 14:57:03 CEST 2011
Hi,

with the new Unicode API, there are many checks like:
+        if (PyUnicode_READY(*filename))
+            goto handle_error;

Every time I read it, I get it wrong:
   "If filename is ready, then fail"
then I have to remember that the function returns either 0 or -1.

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?

-- 
Amaury Forgeot d'Arc
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