[Python-Dev] check for PyUnicode_READY look backwards

Amaury Forgeot d'Arc amauryfa at gmail.com
Fri Oct 7 00:07:58 CEST 2011


2011/10/6 Benjamin Peterson <benjamin at python.org>:
> Why not just have it return 0 on error? This would be more consistent with API
> functions that return "false" values like NULL and would just be
>
> if (!PyUnicode_READY(s)) return NULL;

Most functions of the Python C API seems to follow one of two ways to
indicate an error:
- functions that return PyObject* will return NULL
- functions that return an int will return -1

-- 
Amaury Forgeot d'Arc


More information about the Python-Dev mailing list