Skip to content

Add _PyObject_VectorcallMethod() function #81518

Closed

Description

@jdemeyer
BPO 37337
Nosy @encukou, @methane, @markshannon, @jdemeyer, @ZackerySpytz
PRs
  • bpo-37337: Add _PyObject_VectorcallMethod() #14228
  • bpo-37337: Add _PyObject_CallMethodNoArgs() #14267
  • bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c #14814
  • 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 2019-07-08.08:29:02.702>
    created_at = <Date 2019-06-19.09:35:31.586>
    labels = []
    title = 'Add _PyObject_VectorcallMethod() function'
    updated_at = <Date 2019-08-14.05:51:09.280>
    user = 'https://github.com/jdemeyer'

    bugs.python.org fields:

    activity = <Date 2019-08-14.05:51:09.280>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-08.08:29:02.702>
    closer = 'petr.viktorin'
    components = []
    creation = <Date 2019-06-19.09:35:31.586>
    creator = 'jdemeyer'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37337
    keywords = ['patch']
    message_count = 6.0
    messages = ['346032', '346816', '347487', '347490', '348065', '349648']
    nosy_count = 5.0
    nosy_names = ['petr.viktorin', 'methane', 'Mark.Shannon', 'jdemeyer', 'ZackerySpytz']
    pr_nums = ['14228', '14267', '14814']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37337'
    versions = []

    Activity

    1. jdemeyer commented on Jun 19, 2019

      @jdemeyer
      ContributorAuthor

      To augment the various PyObject_CallMethod...() functions, we add _PyObject_VectorcallMethod() which uses the vectorcall calling convention. To be consistent with the other vectorcall functions, this function is provisional for now.

      For efficiency, the "self" argument is NOT passed as separate argument but as part of the usual args array. In other words, the call looks like an unbound method call.

      I am also adding _PyObject_VectorcallMethodId() taking a _Py_Identifier* as argument and convenience functions PyObject_CallMethodNoArgs() and _PyObject_CallMethodIdNoArgs(), analogous to the recently added PyObject_CallNoArgs().

    2. methane commented on Jun 28, 2019

      @methane
      Member

      New changeset b1263d5 by Inada Naoki (Jeroen Demeyer) in branch 'master':
      bpo-37337: Add _PyObject_VectorcallMethod() (GH-14228)
      b1263d5

    3. methane commented on Jul 8, 2019

      @methane
      Member

      New changeset 762f93f by Inada Naoki (Jeroen Demeyer) in branch 'master':
      bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)
      762f93f

    4. encukou commented on Jul 8, 2019

      @encukou
      Member

      Thank you, Jeroen and INADA-san!

    5. ZackerySpytz commented on Jul 17, 2019

      ZackerySpytzmannequin
      Mannequin

      Commit b1263d5 causes GCC 9.1.0 to give a warning in Objects/descrobject.c.

      Objects/descrobject.c:1050:19: warning: cast between incompatible function types from ‘PyObject * ()(mappingproxyobject *, PyObject * const, Py_ssize_t)’ {aka ‘struct _object * ()(struct <anonymous> *, struct _object * const, long int)’} to ‘PyObject * ()(PyObject *, PyObject *)’ {aka ‘struct _object * ()(struct _object *, struct _object *)’} [-Wcast-function-type]
      1050 | {"get", (PyCFunction)mappingproxy_get, METH_FASTCALL,
      | ^

      PR 14814 fixes this.

    6. methane commented on Aug 14, 2019

      @methane
      Member

      New changeset 43d564c by Inada Naoki (Zackery Spytz) in branch 'master':
      bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (GH-14814)
      43d564c

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

    No one assigned

      Labels

      No labels
      No labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions