We need a basic abstraction over the object layer.
This includes:
PyObject - abstract objects
str, bytes, list, tuple, etc. - concrete objects
- Conversion between concrete and abstract objects
Creating custom objects (classes) is a separate task
Things to keep in mind:
- since a PyObject can be mutated by C code anywhere at any time, we can never have an
&mut PyObject.
- since
& references are immutable we need to specify that the object abstraction has interior mutability
Therefore I propose we use the definition from PyO3:
https://github.com/PyO3/pyo3/blob/ab7b0d303be0c3948866519583dd32332f6c3d22/src/types/any.rs#L33
i.e. a transparent wrapper around UnsafeCell<ffi::PyObject>
We need a basic abstraction over the object layer.
This includes:
PyObject- abstract objectsstr,bytes,list,tuple, etc. - concrete objectsCreating custom objects (classes) is a separate task
Things to keep in mind:
&mut PyObject.&references are immutable we need to specify that the object abstraction has interior mutabilityTherefore I propose we use the definition from PyO3:
https://github.com/PyO3/pyo3/blob/ab7b0d303be0c3948866519583dd32332f6c3d22/src/types/any.rs#L33
i.e. a transparent wrapper around
UnsafeCell<ffi::PyObject>