Cecilia Alm wrote:
> Why does the identity operator return "True" in the below cases, that is
> when assigning the same value to basic variable types (float, integer,
> string, bool..)? Are these rcopied by reference (shallow)? If so why?
Assignment in Python is always by reference. Variables i
>> Why does the identity operator return "True" in the below cases,
>> that is when assigning the same value to basic variable types
>> (float, integer, string, bool..)? Are these rcopied by reference
>> (shallow)? If so why?
>>
> i = 10
> j = 10
> i is j
>> True
The above you have
On 10/02/07, Cecilia Alm <[EMAIL PROTECTED]> wrote:
> Why does the identity operator return "True" in the below cases, that is
> when assigning the same value to basic variable types (float, integer,
> string, bool..)? Are these rcopied by reference (shallow)? If so why?
>
> >>> i = 10
> >>> j =
On Feb 9, 2007, at 10:34 PM, Cecilia Alm wrote:
> Why does the identity operator return "True" in the below cases,
> that is when assigning the same value to basic variable types
> (float, integer, string, bool..)? Are these rcopied by reference
> (shallow)? If so why?
>
> >>> i = 10
> >>>
Why does the identity operator return "True" in the below cases, that is
when assigning the same value to basic variable types (float, integer,
string, bool..)? Are these rcopied by reference (shallow)? If so why?
i = 10
j = 10
i is j
True
a = 10
b = a
a is b
True
Thanks!