Message 104772 - Python tracker (original) (raw)

Thinking about it a bit more, I really would prefer get_range_argument not to steal a reference. If I'm reading a bit of C code and encounter something like:

obj = transform(obj); if (obj == NULL) ...

my hindbrain immediately starts fretting that something's wrong, and I have to go and ferret out the definition of 'transform' to be sure. In contrast, patterns like:

temp = transform(obj); Py_DECREF(obj); obj = temp; if (obj == NULL) ...

are so common and familiar in the Python codebase that they don't raise the same sort of red flag.