Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PyNoArgsFunction #62291

Closed
larryhastings opened this issue May 29, 2013 · 5 comments
Closed

Remove PyNoArgsFunction #62291

larryhastings opened this issue May 29, 2013 · 5 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@larryhastings
Copy link
Contributor

BPO 18091
Nosy @pitrou, @larryhastings, @benjaminp, @serhiy-storchaka
Superseder
  • bpo-39372: The header files in Include/ have many declarations with no definition
  • 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 = None
    closed_at = <Date 2020-01-18.09:27:00.653>
    created_at = <Date 2013-05-29.02:00:44.172>
    labels = ['interpreter-core', 'type-bug']
    title = 'Remove PyNoArgsFunction'
    updated_at = <Date 2020-01-18.09:29:35.033>
    user = 'https://github.com/larryhastings'

    bugs.python.org fields:

    activity = <Date 2020-01-18.09:29:35.033>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-01-18.09:27:00.653>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2013-05-29.02:00:44.172>
    creator = 'larry'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 18091
    keywords = []
    message_count = 5.0
    messages = ['190264', '190287', '190317', '360241', '360242']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'larry', 'benjamin.peterson', 'Arfrever', 'serhiy.storchaka']
    pr_nums = []
    priority = 'low'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '39372'
    type = 'behavior'
    url = 'https://bugs.python.org/issue18091'
    versions = ['Python 3.4']

    @larryhastings
    Copy link
    Contributor Author

    There's a typedef in methodobject.h called PyNoArgsFunction. You might think it's used for METH_NOARGS functions--you'd be wrong, those use PyCFunction and pass in NULL for args.

    No, PyNoArgsFunction is never used. Nor is it documented. It's found in exactly one place in the CPython tree, and that's when it's declared. We should consider removing it.

    Note that I'm pretty sure this will break external code; a quick Google found that Blender's extension interface uses it. And AFAICT they still use it, and they *have* moved to Python 3. So I could believe the right call is "we better leave it in".

    I suspect that PyNoArgsFunction *was* used once upon a time. I further suspect that year started with a 1.

    @larryhastings larryhastings added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels May 29, 2013
    @larryhastings
    Copy link
    Contributor Author

    Either of you gentlemen care to offer an opinion?

    @benjaminp
    Copy link
    Contributor

    If you want to convince Blender to stop using it, you can kill it. It's seems fairly harmless, though.

    @serhiy-storchaka
    Copy link
    Member

    Removed in bpo-39372 together with other unused declarations.

    PyNoArgsFunction was the only one that breaks a user code. But using PyNoArgsFunction is likely a sign of error.

    @serhiy-storchaka
    Copy link
    Member

    I cannot report a bug in Blender, because get an exception on link https://developer.blender.org/maniphest/project/2/type/Bug/ .

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants