[Python-Dev] Python memory model (low level)
"Martin v. Löwis"
martin at v.loewis.de
Fri Jun 30 22:30:47 CEST 2006
Tim Peters wrote:
> Don't know what "raw data" might mean here. Any Python object can be
> bound to any attribute of a class. In Python, e.g.,
> class MyClass:
> mydata = ['xyz', 12]
> def method(self):
> # or, more inheritance-friendly
> This is substantially more long-winded in C.
To get a starting point:
is the equivalent of
That way, the raw data would get exposed to the Python level.
If you don't want this to happen, you could also revert the
static PyObject *mydata; /* = PyDict_New() */
If "raw" means "non-PyObject", you would have to wrap the
raw data pointer with a CObject first.
More information about the Python-Dev