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

Martin v. Loewis martin@v.loewis.de
Thu, 10 Jan 2002 08:27:39 +0100


> Or, to make things clearer, WinObj_Type->tp_convert would simply
> point to the current WinObj_Convert function.

So what do you gain with that extension? It seem all that is done is
you can replace _Convert by _Type everywhere, with no additional
change to the semantics.

> > > ps_GetDrawableSurface = calldll.newcall(psapilib.ps_GetDrawableSurface,
> > > 	Carbon.Qd.GrafPortType)
[...]
> Not at the moment, but in calldll version 2 there would be. In stead
> of passing types as "l" or "h" you would pass type objects to
> newcall(). Newcall() would probably special-case the various ints but
> for all other types simply call PyArg_Parse(arg, "O@", typeobj,
> &voidptr). 

I still don't understand. In your example, GrafPortType is a return
type, not an argument type. So you *have* an anything, and you *want*
the GrafPortType. How exactly do you use PyArg_Parse in that scenario?

Also, why would you use this extension inside newcall()? I'd rather
expect it in ps_GetDrawableSurface.__call__ instead (i.e. when you
deal with a specific call, not when you create the callable instance).

Regards,
Martin