One other issue is whether the output parameter should be touched if there is no meaningful value.
Take PyDict_GetItemSuffixToBeDecided(PyDictObject *op, PyObject *key, PyObject **pvalue).
Should we touch *pvalue if returning -1 or 0.
In other words, in
PyObject *value;
int err = PyDict_GetItemSuffixToBeDecided(op, key, &value);
Should value be undefined if err <= 0, or should it be set to NULL?
It is more efficient to not touch it, since the return value specifies that it has no meaning.
But, do we trust all C extension authors not to read the value, which may point to a real object if they are unlucky? Setting *pvalue = NULL is safer.
Originally posted by @markshannon in #1121 (comment)
Originally posted by @markshannon in #1121 (comment)