On Tue, 09 Oct 2007 21:25:38 +0200, Laszlo Nagy wrote:

> a = 1
> a+= 1 # The compiler will probably optimize this and the Python bytecode
> interpreter will not rebind 'a' here, just increment the integer in
> memory.

No. This is Python, not C. You can't increment integers in memory. 
Integers are immutable objects, not raw bytes:

>>> x = 1
>>> id(x)
150830896
>>> x += 1
>>> id(x)
150830884




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

Reply via email to