469,592 Members | 1,713 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Puzzled by "is"

>>() is ()
True
>>(1,) is (1,)
False

Why?

Thanks,

Dick Moores

Aug 9 '07 #1
1 931
On 2007-08-09, Dick Moores <rd*@rcblue.comwrote:
>() is ()
True
>(1,) is (1,)
False

Why?
From _Python Reference Manual_: 5.2.4 List displays:

An empty pair of parentheses yields an empty tuple object.
Since tuples are immutable, the rules for literals apply (i.e.,
two occurrences of the empty tuple may or may not yield the
same object).

--
Neil Cerutti
Aug 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ajax Chelsea | last post: by
235 posts views Thread by napi | last post: by
24 posts views Thread by hjbortol | last post: by
60 posts views Thread by K. G. Suarez | last post: by
15 posts views Thread by Bobby C. Jones | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.