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

Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef* #71519

Closed
encukou opened this issue Jun 16, 2016 · 4 comments
Assignees
Labels
topic-argument-clinic type-bug An unexpected behavior, bug, or error

Comments

@encukou
Copy link
Member

encukou commented Jun 16, 2016

BPO 27332
Nosy @ncoghlan, @larryhastings, @encukou, @serhiy-storchaka
Files
  • 0001-clinic-Switch-the-module-argument-to-PyObject.patch: Patch
  • 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/serhiy-storchaka'
    closed_at = <Date 2016-07-07.15:21:19.226>
    created_at = <Date 2016-06-16.16:33:33.045>
    labels = ['type-bug', 'expert-argument-clinic']
    title = 'Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*'
    updated_at = <Date 2016-07-07.15:21:19.225>
    user = 'https://github.com/encukou'

    bugs.python.org fields:

    activity = <Date 2016-07-07.15:21:19.225>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2016-07-07.15:21:19.226>
    closer = 'serhiy.storchaka'
    components = ['Argument Clinic']
    creation = <Date 2016-06-16.16:33:33.045>
    creator = 'petr.viktorin'
    dependencies = []
    files = ['43418']
    hgrepos = []
    issue_num = 27332
    keywords = ['patch']
    message_count = 4.0
    messages = ['268676', '269934', '269935', '269939']
    nosy_count = 5.0
    nosy_names = ['ncoghlan', 'larry', 'petr.viktorin', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27332'
    versions = ['Python 3.5', 'Python 3.6']

    @encukou
    Copy link
    Member Author

    encukou commented Jun 16, 2016

    Currently, Argument Clinic generates "PyModuleDef * module" for the first argument of module-level functions. But, the functions are passed the actual module object, not the ModuleDef.

    The correct type to use is PyObject*, which is used for modules in the PyModule_* API.

    (It turns out nothing in core Python currently uses the argument except passing it to other _impl functions, but this could change as PEP-489 is improved upon.)

    The attached patch contains manual changes only. Please run make clinic after applying it to regenerate allll the code.

    @encukou
    Copy link
    Member Author

    encukou commented Jul 7, 2016

    Hello,
    Is there anything I can do to help get this issue resolved?

    @serhiy-storchaka
    Copy link
    Member

    LGTM. Thank you for your contribution Petr.

    @serhiy-storchaka serhiy-storchaka self-assigned this Jul 7, 2016
    @serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Jul 7, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 7, 2016

    New changeset 870e02f86e08 by Serhiy Storchaka in branch '3.5':
    Issue bpo-27332: Fixed the type of the first argument of module-level functions
    https://hg.python.org/cpython/rev/870e02f86e08

    New changeset c80054ccbbd8 by Serhiy Storchaka in branch 'default':

    @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
    topic-argument-clinic type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants