forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
We need a basic abstraction over the object layer.
This includes:
PyObject- abstract objectsstr,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>
youknowone