On Sat, 11 Aug 2007 09:43:19 -0700, MD wrote:
I have a Python C extension which is passed a PyObject containing
an integer value. Is it possible to change this same PyObject so that
now the integer is of a different value?
No it is not. Even if you poke around in the object ``struct`` this would
have severe consequences for cached/shared objects. Just imagine:
from your_module import bzzzt
def f():
print 2 + 2
bzzzt(2) # This changes the value of 2 to 3.
f() # This prints '6'!
Ciao,
Marc 'BlackJack' Rintsch