Re: [Tutor] An identity question

2007-04-22 Thread Andreas Kostyrka
* Cecilia Alm <[EMAIL PROTECTED]> [070422 22:34]: > The differences in cases 1 and 3 vs. 2 is due to 'common values' of > name assignments being treated a bit differently, right? Also, it's > clear why case 5 evaluates to false. But, why does the case 4 > equality check evaluate to True, whereas c

Re: [Tutor] An identity question

2007-04-22 Thread Cecilia Alm
OK. I guess the same holds for the below list-internal values. It doesn't seem that this could lead to unexpected aliasing 'conflict' when assigning new values to names. Thanks, C >>> def foo3(): ...x = [232131, 321321, 432432] ...return x ... >>> a = foo3() >>> b = foo3() >>> a is b False

Re: [Tutor] An identity question

2007-04-22 Thread Kent Johnson
Cecilia Alm wrote: > The differences in cases 1 and 3 vs. 2 is due to 'common values' of > name assignments being treated a bit differently, right? Also, it's > clear why case 5 evaluates to false. But, why does the case 4 > equality check evaluate to True, whereas case 1 and 3 don't? > > case 4:

[Tutor] An identity question

2007-04-22 Thread Cecilia Alm
The differences in cases 1 and 3 vs. 2 is due to 'common values' of name assignments being treated a bit differently, right? Also, it's clear why case 5 evaluates to false. But, why does the case 4 equality check evaluate to True, whereas case 1 and 3 don't? case 1: >>> a = 1 >>> b = 1 >>