[issue28977] Document PyObject_CallFunction() special case more explicitly

2021-09-21 Thread STINNER Victor
STINNER Victor added the comment: I don't know what to do with this old issue, so I prefer to simply close it. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___

[issue28977] Document PyObject_CallFunction() special case more explicitly

2016-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > All other format codes are illegal for single argument. I was wrong. PyObject_CallFunction() handles correctly a single non-tuple argument. The problem is only with tuple result of Py_BuildValue(). > What do you mean exactly by deprecating the feature? Emi

[issue28977] Document PyObject_CallFunction() special case more explicitly

2016-12-16 Thread STINNER Victor
STINNER Victor added the comment: If the behaviour of PyObject_CallFunction(func, "O", arg) is changed, an application relying on the current behaviour would have to replace: res = PyObject_CallFunction(func, "O", arg); with: /* code working on any Python version */ if (PyTuple_Check

[issue28977] Document PyObject_CallFunction() special case more explicitly

2016-12-16 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: "O" is not the only special case. "S" and "N" unpack a tuple argument too. "O&" converter should return a tuple, otherwise it is an error. All other format codes are illegal for single argument. Oh, I didn't know. I should update my documentation. Se

[issue28977] Document PyObject_CallFunction() special case more explicitly

2016-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: "O" is not the only special case. "S" and "N" unpack a tuple argument too. "O&" converter should return a tuple, otherwise it is an error. All other format codes are illegal for single argument. I would just deprecate this feature (in PyObject_CallFunction,

[issue28977] Document PyObject_CallFunction() special case more explicitly

2016-12-15 Thread STINNER Victor
New submission from STINNER Victor: The PyObject_CallFunction() function has a special case if the format string is "O". See my email thread on python-dev: https://mail.python.org/pipermail/python-dev/2016-December/146919.html Serhiy wrote: "It is documented for Py_BuildValue(), and the documen