[Python-Dev] check for PyUnicode_READY look backwards (original) (raw)
Ronald Oussoren ronaldoussoren at mac.com
Thu Oct 6 16:31:00 CEST 2011
- Previous message: [Python-Dev] check for PyUnicode_READY look backwards
- Next message: [Python-Dev] check for PyUnicode_READY look backwards
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 6 Oct, 2011, at 14:57, Amaury Forgeot d'Arc wrote:
Hi,
with the new Unicode API, there are many checks like: + if (PyUnicodeREADY(*filename)) + goto handleerror; 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 (PyUnicodeREADY(*filename) < 0) because "< 0" clearly indicates an error condition. That's how all calls to PyTypeReady 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.
Ronald
-- Amaury Forgeot d'Arc
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/ronaldoussoren%40mac.com
-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4788 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20111006/7cc5f1ed/attachment.bin>
- Previous message: [Python-Dev] check for PyUnicode_READY look backwards
- Next message: [Python-Dev] check for PyUnicode_READY look backwards
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]