[PyKDE] Sip wishlist item: Parameter typechecking enhancement

Phil Thompson phil at riverbankcomputing.co.uk
Mon Jul 18 18:49:08 BST 2005


On Monday 18 July 2005 5:43 pm, Nigel Stewart wrote:
> >>In a nutshell, I want a wrapped constructor to pass
> >>a wrapped Foo as a PyObject parameter, but I'd prefer
> >>sip to do the typecheck that PyObject is a Foo, rather
> >>than trying to deal with it on the C++ side.
> >
> > How about the GetWrapper annotation?
>
> 	Nearly!
>
> 	Annotating the parameter with GetWrapper
> 	makes the PyObject available as a0Wrapper,
> 	and doing the type check...
>
> 	...but a0 is being passed as the argument,
> 	rather than a0Wrapper.
>
> 	Is there a way to avoid maintaining
> 	method code to pass q0Wrapper
> 	rather than a0?
>
>  >     Bar(Foo & /GetWrapper/);
> >
> >     Bar(Foo & /PassWrapper/);   ??

No. I think this is too specialised a requirement to justify automating it.

Phil




More information about the PyQt mailing list