Py_BuildValue format code for unsigned int ?

H

Helmut Jarausch

Hi,

is there a format code to return an unsigned int to Python via
Py_BuildValue? Just using code 'i' gives negative values for values
greater than 2**31.

I've tried the code 'I' (with python 2.4 cvs) but that's not accepted.

Many thanks for a hint,
 
M

Mike C. Fletcher

*PyLong_FromUnsignedLong to get a PyObject * to a Python long object,
then use the N format to steal the reference you're creating with
**PyLong_FromUnsignedLong.

HTH,
Mike
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top