Skip to content

Prepare CPython for opaque PyObject structure. #85360

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

Closed
WildCard65 mannequin opened this issue Jul 1, 2020 · 2 comments
Closed

Prepare CPython for opaque PyObject structure. #85360

WildCard65 mannequin opened this issue Jul 1, 2020 · 2 comments
Labels
3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-C-API type-feature A feature request or enhancement

Comments

@WildCard65
Copy link
Mannequin

WildCard65 mannequin commented Jul 1, 2020

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']

    @WildCard65
    Copy link
    Mannequin Author

    WildCard65 mannequin commented Jul 1, 2020

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

    @WildCard65 WildCard65 mannequin added 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-C-API type-feature A feature request or enhancement labels Jul 1, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @iritkatriel
    Copy link
    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.

    @iritkatriel iritkatriel closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-C-API type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant