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): > MyClass.mydata.append(-1) > # or, more inheritance-friendly > self.__class__.mydata.append(-1) > > This is substantially more long-winded in C.
To get a starting point: PyDict_GetItemString(MyClass->tp_dict, "mydata") is the equivalent of self.__class__.mydata 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 lookup: static PyObject *mydata; /* = PyDict_New() */ and then PyDict_GetItem(mydata, MyClass) If "raw" means "non-PyObject", you would have to wrap the raw data pointer with a CObject first. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com