Py_BuildValue format code for unsigned int ?

Discussion in 'Python' started by Helmut Jarausch, Feb 25, 2004.

  1. 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
     
    Helmut Jarausch, Feb 25, 2004
    #1
    1. Advertising

  2. *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/
     
    Mike C. Fletcher, Feb 25, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timo Freiberger
    Replies:
    3
    Views:
    953
    Bob Hairgrove
    Oct 30, 2004
  2. Christian Vogel
    Replies:
    2
    Views:
    3,734
    Christian Vogel
    Feb 25, 2004
  3. er
    Replies:
    6
    Views:
    492
    Andre Kostur
    Sep 14, 2007
  4. ciccio

    int*unsigned int = unsigned?

    ciccio, Jun 4, 2010, in forum: C++
    Replies:
    2
    Views:
    413
    Öö Tiib
    Jun 4, 2010
  5. pozz
    Replies:
    12
    Views:
    745
    Tim Rentsch
    Mar 20, 2011
Loading...

Share This Page