Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Py_BuildValue format code for unsigned int ?

Reply
Thread Tools

Py_BuildValue format code for unsigned int ?

 
 
Helmut Jarausch
Guest
Posts: n/a
 
      02-25-2004
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,

---
Helmut Jarausch
RWTH-Aachen University
Germany
 
Reply With Quote
 
 
 
 
Mike C. Fletcher
Guest
Posts: n/a
 
      02-25-2004
*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
*
Helmut Jarausch wrote:

> 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,
>
> ---
> Helmut Jarausch
> RWTH-Aachen University
> Germany



--
_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(int) -> (unsigned) -> (int) or (unsigned) -> (int) -> (unsigned):I'll loose something? pozz C Programming 12 03-20-2011 11:32 PM
int*unsigned int = unsigned? ciccio C++ 2 06-04-2010 01:54 PM
is vec.reserve(unsigned int) better than vec(unsigned int)? er C++ 6 09-14-2007 06:20 AM
unsigned int const does not match const unsigned int Timo Freiberger C++ 3 10-30-2004 07:02 PM
Python/C: unsigned Py_BuildValue, PyInt_FromLong Christian Vogel Python 2 02-25-2004 10:05 PM



Advertisments