[PyQt] SIP Question

Robin Dunn robin at alldunn.com
Sat Nov 20 18:44:49 GMT 2010


On 11/20/10 4:20 AM, Phil Thompson wrote:
> On Sat, 20 Nov 2010 02:14:55 -0800, Robin Dunn<robin at alldunn.com>  wrote:
>> Is there a way to get SIP to treat an "unsigned char" as a number rather
>
>> than as a string of length 1?  Doing something like a MappedType for a
>> "byte" typedef feels like overkill, especially for a POD type.
>
> No, but should be able to. I'll add a /PyInt/ argument annotation.


Please also add /PyInt/ for functions so it will create the return value 
as an integer too.

On 11/20/10 6:14 AM, Giovanni Bajo wrote:
> How is this different from declaring the argument as "unsigned int" in the
> SIP file?

I actually tried something like this but had some problems. There 
appeared to be some overflow problems when the args were parsed.  On 
Windows one arg ended up with a value of zero when it should have been 
one, and on Mac there was a segfault shortly after the wrapper returned 
to the siplib code.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org



More information about the PyQt mailing list