Skip to content

Can I change the signature of ob_item of PyTupleObject and PyListObject? #64

@Fidget-Spinner

Description

@Fidget-Spinner

I want to change

typedef struct {
    PyObject_VAR_HEAD
    PyObject **ob_item;
    Py_ssize_t allocated;
} PyListObject;

to

typedef struct {
    PyObject_VAR_HEAD
    _PyHeapRef *ob_item;
    Py_ssize_t allocated;
} PyListObject;

There is no change in size of the struct or offsets, _PyHeapRef is an opaque struct.

Does this require a PEP?

Discourse issue here https://discuss.python.org/t/open-question-can-we-change-the-field-type-of-pytupleobject-and-pylistobject/91318

I mainly want to do this to supported tagged integers in CPython list and tuples.

Vote

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions