Issue 8276: useless PyEval_CallObject function (original) (raw)

Created on 2010-03-31 22:06 by fijal, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg102038 - (view) Author: Maciek Fijalkowski (fijal) Date: 2010-03-31 22:06
In ceval.c there is such code: PyObject * PyEval_CallObject(PyObject *func, PyObject *arg) { return PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL); } #define PyEval_CallObject(func,arg) \ PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL) Is this needed any longer? (both #define and function have the same name)
msg102039 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-03-31 22:09
Well, #defines are not exported in shared libraries. I suppose PyEval_CallObject() was part of an old definition of the Python C-API and it was kept for compatibility.
msg102040 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-03-31 22:10
The #define dates back from 2007, this changeset: branch: trunk user: guido date: Sat Aug 30 17:02:50 1997 +0200 files: Include/ceval.h Python/ceval.c description: [svn r8683] Inline PyObject_CallObject (Marc-Andre Lemburg).
msg102041 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2010-03-31 22:20
Antoine Pitrou wrote: > > Antoine Pitrou <pitrou@free.fr> added the comment: > > The #define dates back from 2007, this changeset: > > branch: trunk > user: guido > date: Sat Aug 30 17:02:50 1997 +0200 > files: Include/ceval.h Python/ceval.c > description: > [svn r8683] Inline PyObject_CallObject (Marc-Andre Lemburg). That's not useless: it's a typical backwards compatibility macro to auto-upgrade existing software via recompile. It's also still used a lot in the Python source code and elsewhere: http://www.google.de/search?q=PyEval_CallObject The function PyEval_CallObject() can probably be removed by now, though.
msg102050 - (view) Author: Maciek Fijalkowski (fijal) Date: 2010-04-01 01:33
Yeah, I meant the function. Sorry for not being specific enough. I suppose the function is there to preserve ABI, but definitely code needed recompilation since 2007.
msg102100 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-04-01 15:09
Right, we can certainly suppress the function definition now and just keep the macro. (especially given it's 1997, not 2007, there was a typo in my message)
msg102105 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-04-01 16:53
Fixed in r79555 (trunk), r79556 (py3k).
History
Date User Action Args
2022-04-11 14:56:59 admin set github: 52523
2010-04-01 16:53:54 pitrou set status: open -> closedresolution: fixedstage: needs patch -> resolved
2010-04-01 16:53:44 pitrou set messages: +
2010-04-01 15:09:57 pitrou set priority: normalversions: + Python 3.2messages: + assignee: pitroutype: enhancementstage: needs patch
2010-04-01 01:33:39 fijal set messages: +
2010-03-31 22:20:48 lemburg set messages: +
2010-03-31 22:10:39 pitrou set nosy: + lemburgmessages: +
2010-03-31 22:09:18 pitrou set nosy: + pitroumessages: +
2010-03-31 22:06:51 fijal create