[Python-Dev] Feature request: better support for "wrapper" objects
Thomas Heller
thomas.heller@ion-tof.com
Wed, 9 Jan 2002 17:56:47 +0100
> > > You cannot do this currently, because there is no way to get from the type
> > > object (which is the only thing you have available in Python) to the functions
> > > you need to pass to O&.
> >
> > In Python 2.2, the type object can itself be an instance, and you could call
> > classmethods on it...
> > I'm doing something similar on windows.
>
> Could you explain how you do this? If I have the typeobject, how would I get
> to the address of the "int (*converter)(PyObject *, void *)" function?
Jack, it seems I misunderstood you (slightly?).
I was talking about the other direction (constructing Python objects
from C pointers or handles).
I had to invent a special convention: I use O& with a function which
calls obj->as_parameter() to convert from Python to C, but of course
this gives you no typechecks as your O@ proposal does.
I've reread your original O@ proposal, and I like it very much.
Aren't there really any other positive responses?
Thomas