Skip to content

[WIP] Add a new experimental _Py_CAPI2 API #79387

Closed

Description

@vstinner
BPO 35206
Nosy @vstinner
PRs
  • [WIP] bpo-35206: Add new experimental _Py_CAPI2 API #10443
  • 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 2018-11-22.16:27:53.358>
    created_at = <Date 2018-11-10.01:37:33.708>
    labels = ['interpreter-core', '3.8']
    title = '[WIP] Add a new experimental _Py_CAPI2 API'
    updated_at = <Date 2018-11-22.16:27:53.356>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2018-11-22.16:27:53.356>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-11-22.16:27:53.358>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2018-11-10.01:37:33.708>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35206
    keywords = ['patch']
    message_count = 3.0
    messages = ['329583', '329584', '330268']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['10443']
    priority = 'normal'
    resolution = 'rejected'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue35206'
    versions = ['Python 3.8']

    Activity

    1. vstinner commented on Nov 10, 2018

      @vstinner
      MemberAuthor

      Add a new experimental "_Py_CAPI2" API: opt-in which doesn't leak implementation details and replace macros with function calls.

      Attached PR modified PyTuple_GET_ITEM() if _Py_CAPI2 is defined.

      With this API, PyTuple_GET_ITEM() macro becomes a function call and
      the implementation uses assertions to check if the first argument is
      a tuple and that the index is valid. It should help to investigate
      bugs when Python is compiled in debug mode.

      This issue implements the idea that I proposed on python-dev:
      https://mail.python.org/pipermail/python-dev/2018-November/155702.html

    2. vstinner commented on Nov 10, 2018

      @vstinner
      MemberAuthor

      I previously tried a very similar patch but reusing Py_DEBUG define, rather than adding a new _Py_CAPI2 define: bpo-35199. I abandonned it because it was backward incompatible. This change is backward compatible: the new API is not compatible with the current API, but the change doesn't impact the default API which remains unchanged.

    3. changed the title [-]Add new experimental _Py_CAPI2 API[/-] [+]Add a new experimental _Py_CAPI2 API[/+] on Nov 10, 2018
    4. changed the title [-]Add a new experimental _Py_CAPI2 API[/-] [+][WIP] Add a new experimental _Py_CAPI2 API[/+] on Nov 10, 2018
    5. vstinner commented on Nov 22, 2018

      @vstinner
      MemberAuthor

      According to discussions on python-dev, a PEP will be needed first. Moreover, I prefer to make some progress on https://bugs.python.org/issue35134 before. I close the issue.

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

      3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions