By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,286 Members | 1,140 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,286 IT Pros & Developers. It's quick & easy.

Puzzled by "is"

P: n/a
>>() is ()
True
>>(1,) is (1,)
False

Why?

Thanks,

Dick Moores

Aug 9 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
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.