Python interpreter bug

alainpoint at alainpoint at
Fri Oct 7 21:07:56 CEST 2005

> Steve Holden wrote:

 >>> a = {1:'one'}
 >>> b = {2:'two'}
 >>> c = {1:'one'}
 >>> a is c
 >>> a in [b, c]

>What would you have Python do differently in these circumstances?

You mean: What i would do i if i was the benevolent dictator ?
I would make a distinction between mutables and immutables. Immutables
would test for equality and mutables would test for identity.
Membership testing for objects is a very common use case which is
totally unrelated to their being sorted according to a key.
I am no expert on languages so i could be wrong. Don't hesitate to
correct me.

More information about the Python-list mailing list