Skip to content

useless PyEval_CallObject function #52523

Closed

Description

@fijal
BPO 8276
Nosy @malemburg, @pitrou

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/pitrou'
closed_at = <Date 2010-04-01.16:53:54.496>
created_at = <Date 2010-03-31.22:06:51.464>
labels = ['interpreter-core', 'type-feature']
title = 'useless PyEval_CallObject function'
updated_at = <Date 2010-04-01.16:53:54.495>
user = 'https://bugs.python.org/fijal'

bugs.python.org fields:

activity = <Date 2010-04-01.16:53:54.495>
actor = 'pitrou'
assignee = 'pitrou'
closed = True
closed_date = <Date 2010-04-01.16:53:54.496>
closer = 'pitrou'
components = ['Interpreter Core']
creation = <Date 2010-03-31.22:06:51.464>
creator = 'fijal'
dependencies = []
files = []
hgrepos = []
issue_num = 8276
keywords = []
message_count = 7.0
messages = ['102038', '102039', '102040', '102041', '102050', '102100', '102105']
nosy_count = 3.0
nosy_names = ['lemburg', 'pitrou', 'fijal']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue8276'
versions = ['Python 2.7', 'Python 3.2']

Activity

  1. fijal commented on Mar 31, 2010

    @fijal
    Author

    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)

  2. added
    interpreter-core
    on Mar 31, 2010
  3. pitrou commented on Mar 31, 2010

    @pitrou
    Member

    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.

  4. pitrou commented on Mar 31, 2010

    @pitrou
    Member

    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).

  5. malemburg commented on Mar 31, 2010

    @malemburg
    Member

    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.

  6. fijal commented on Apr 1, 2010

    @fijal
    Author

    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.

  7. pitrou commented on Apr 1, 2010

    @pitrou
    Member

    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)

  8. self-assigned this
    on Apr 1, 2010
  9. added
    type-feature
    on Apr 1, 2010
  10. pitrou commented on Apr 1, 2010

    @pitrou
    Member

    Fixed in r79555 (trunk), r79556 (py3k).

  11. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

interpreter-coretype-feature

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions