Cheers,
pujo
On 11/7/06, Tim Johnson <
[EMAIL PROTECTED]> wrote:
* Kent Johnson < [EMAIL PROTECTED]> [061106 10:31]:
>
> In [9]: a=[1,2]
>
> In [10]: b=[1,2]
Hmmm! Hmmm!
Lookee here:
## console session
>>> a=[1,2]
>>> b=[1,2]
>>> a is b
False
>>> c='1' ## one byte
>>> d='1' ## one byte
>>> c is d
True
>>> c='1,2'
>>> d='1,2'
>>> c is d
False
The Hmmm! is emmitted because I'm thinking that if everything is an
object in python, then why does `c is d` evaluate to True when
the assigned value is 1 byte and evaluate to False when the assigned
value is more that 1 byte?
I think I ran into this before and that's why I never used `is'.
Good thread. Beats flame wars.
thanks
tim
--
Tim Johnson <[EMAIL PROTECTED]>
http://www.alaska-internet-solutions.com
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor