[Python-Dev] Identifier API (original) (raw)
Hrvoje Niksic hrvoje.niksic at avl.com
Tue Oct 11 16:24:01 CEST 2011
- Previous message: [Python-Dev] Identifier API
- Next message: [Python-Dev] Identifier API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/11/2011 02:45 PM, Amaury Forgeot d'Arc wrote:
It should also check for errors; in this case the initialization is a bit more verbose: if (PYIDENTIFIERINIT(update) < 0)_ _<return NULL or return -1 or goto error>;
Error checking is somewhat more controversial because behavior in case of error differs between situations and coding patterns. I think it should be up to the calling code to check for s_update remaining NULL. In my example, I would expect PyObject_CallMethodObj and similar to raise InternalError when passed a NULL pointer. Since their return values are already checked, this should be enought to cover the unlikely case of identifier creation failing.
Hrvoje
- Previous message: [Python-Dev] Identifier API
- Next message: [Python-Dev] Identifier API
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]