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 
routine S repeatedly.  This Python routine S takes three arguments, two 
floats and an integer.  I have read the documentation explaining how R can 
use the C API to construct an argument list for invoking S.  The issue 
that baffles me is that, as far as I can tell, each time R invokes S 
again, it needs to deallocate and reallocate the three arguments.  It 
would seem be much more efficient if R could create the argument list once 
and then modify the values inside of it for each subsequent invocation of 
S.

-- Steve Vavasis


In article <jrudnvsrisf_5phxnz2dnuvz_rodn...@pdx.net>,
Scott David Daniels  <scott.dani...@acm.org> wrote:

>If you do figurte out how to do what you want, you will put us in the
>old FORTRAN trap:  People can write code that changes the value of a
>constant.
>The code:
>     month = 12 # make it december
>     inches_per_foot = 12
>     make_previous(month)
>     print ('Month is now: %s, inches_per_foot = %s' % (
>                month, inches_per_foot))
>might print:
>     Month is now: 11, inches_per_foot = 11
>
>--Scott David Daniels
>scott.dani...@acm.org


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to