On Sun, 30 May 2010 22:08:49 +0200, candide wrote:
> Alf P. Steinbach a écrit :
>> * candide, on 30.05.2010 19:38:
>>> Suppose a Python program defines an integer object with value 42. The
>>> object has an "address" we can capture with the built-in function id()
>>> :
>
>> First, id() doesn't ge
Alf P. Steinbach a écrit :
* candide, on 30.05.2010 19:38:
Suppose a Python program defines an integer object with value 42. The
object has an "address" we can capture with the built-in function id() :
First, id() doesn't generally provide an address.
I talked about a quote unquote "address
Thanks for your responses, I should do more experiments !
--
http://mail.python.org/mailman/listinfo/python-list
On 30 May 2010 18:38:23 UTC+1, candide wrote:
> Two non mutable objects with the same value shall be allocated at a constant
> and unique address ?
Nope.
>>> a = 999
>>> b = 999
>>> id(a) == id(b)
False
Your statement will be the case for small integers, but this in an
implementation detail. I
* candide, on 30.05.2010 19:38:
Suppose a Python program defines an integer object with value 42. The
object has an "address" we can capture with the built-in function id() :
>>> a=42
>>> id(a)
152263540
>>>
Now I was wondering if any integer object with value 42 will be refered
at the same
Suppose a Python program defines an integer object with value 42. The
object has an "address" we can capture with the built-in function id() :
>>> a=42
>>> id(a)
152263540
>>>
Now I was wondering if any integer object with value 42 will be refered
at the same adress with the above id.
Some e