Re: C API: how to replace python number object in place?

2009-05-14 Thread Carl Banks
On May 14, 8:24 pm, vava...@cpu111.math.uwaterloo.ca (Stephen Vavasis) wrote: > In my previous posting, I inquired how to change a python numeric object > in place.  Several people responded that this is not possible.  Perhaps I > should explain the larger problem that I am trying to solve, and the

Re: C API: how to replace python number object in place?

2009-05-14 Thread Stephen Vavasis
In my previous posting, I inquired how to change a python numeric object in place. Several people responded that this is not possible. Perhaps I should explain the larger problem that I am trying to solve, and then the solution will become apparent. I have a C routine R that invokes a Python

Re: C API: how to replace python number object in place?

2009-05-14 Thread Hrvoje Niksic
vava...@cpu111.math.uwaterloo.ca (Stephen Vavasis) writes: > If x is a C variable of type PyObject*, and I happen to know already > that the object is of a numeric type, say int, is there a way to > change the value of x in place to a different number? In the C/API > documentation I found routine

Re: C API: how to replace python number object in place?

2009-05-14 Thread Scott David Daniels
Stephen Vavasis wrote: If x is a C variable of type PyObject*, and I happen to know already that the object is of a numeric type, say int, is there a way to change the value of x in place to a different number? In the C/API documentation I found routines to increment or decrement it in place,

Re: C API: how to replace python number object in place?

2009-05-14 Thread Benjamin Peterson
Stephen Vavasis cpu111.math.uwaterloo.ca> writes: > > If x is a C variable of type PyObject*, and I happen to know already that > the object is of a numeric type, say int, is there a way to change the > value of x in place to a different number? In the C/API documentation I > found routines

C API: how to replace python number object in place?

2009-05-14 Thread Stephen Vavasis
If x is a C variable of type PyObject*, and I happen to know already that the object is of a numeric type, say int, is there a way to change the value of x in place to a different number? In the C/API documentation I found routines to increment or decrement it in place, but I didn't find a rou