Skip to content

Prepare CPython for opaque PyObject structure. #85360

Description

@WildCard65
mannequin
BPO 41188
Nosy @ronaldoussoren, @vstinner, @WildCard65
PRs
  • [WIP, DO NOT MERGE] bpo-41188: Prepare CPython for opague PyObject structure. #21262
  • 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 = None
    created_at = <Date 2020-07-01.17:43:02.332>
    labels = ['interpreter-core', 'expert-C-API', 'type-feature', '3.10']
    title = 'Prepare CPython for opaque PyObject structure.'
    updated_at = <Date 2020-07-07.19:55:22.137>
    user = 'https://github.com/WildCard65'

    bugs.python.org fields:

    activity = <Date 2020-07-07.19:55:22.137>
    actor = 'ronaldoussoren'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Interpreter Core', 'C API']
    creation = <Date 2020-07-01.17:43:02.332>
    creator = 'WildCard65'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41188
    keywords = ['patch']
    message_count = 1.0
    messages = ['372775']
    nosy_count = 3.0
    nosy_names = ['ronaldoussoren', 'vstinner', 'WildCard65']
    pr_nums = ['21262']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue41188'
    versions = ['Python 3.10']

    Activity

    1. WildCard65 commented on Jul 1, 2020

      WildCard65mannequin
      MannequinAuthor

      The goal of bpo-39573 is to make "PyObject" and opaque structure in the limited API.

      To do that, a few mandatory changes will be required to CPython in order to allow for seamless implementation.

      Namely:

      1. User types need to get away from directly referencing PyObject.

        • This can be done by adding a new variable to "PyTypeObject" who's value is an offset into the object's pointer to the type's internal structure.
          -- Example: 'PyType_Type.tp_obj_offset' would be the value of "sizeof(PyVarObject)".
          -- For custom types with another base: The value would be calculated from the base's "tp_obj_offset" + "tp_basicsize"
      2. Create a linkable static library to facility method calls requiring internal implementation.

        • This static library will be implementation defined, IE: using internal methods specific to the runtime that created it.
        • Public facing methods will use generic names for example, "PyObject_GetType" will get the object's ob_type (or whatever the target runtime calls it).
    2. transferred this issue fromon Apr 10, 2022
    3. iritkatriel commented on Jun 25, 2022

      @iritkatriel
      Member

      The PR was closed by the OP after a core dev requested changes. So I am assuming the project was abandoned and closing the issue as well.

    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

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions