[Python-Dev] Feature request: better support for "wrapper" objects

M.-A. Lemburg mal@lemburg.com
Fri, 11 Jan 2002 19:06:04 +0100


[Metatypes, callbacks, etc.]

Wouldn't it be *much* easier to just use the copyreg/pickle 
API/protocol for dealing with all this ? 

AFAICTL, the actions needed by Jack are very similar to what 
pickle et al. do, and we already have all that in Python -- 
it's just not exposed too well at C level. 

Example:

PyArg_ParseTuple(args, "O@", &factory, &tuple) would
return a factory function and a tuple storing the data of
the object passed to the function

while

Py_BuildValue("O@", factory, tuple) would simply call factory
with tuple and use the return value as object.

(Note that void* can be wrapped into PyCObjects for "use" in
Python.)

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                   http://www.egenix.com/files/python/