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) *  |
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) *  |
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) *  |
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) *  |
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) *  |
Date: 2010-04-01 16:53 |
Fixed in r79555 (trunk), r79556 (py3k). |
|
|