Re: Python interpreter bug
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Python interpreter bug

From: <alainpoint@yahoo.fr>
Date: Fri Oct 07 2005 - 21:07:56 CEST

> Steve Holden wrote:
>Consider:

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

>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.
Alain
Received on Sat Oct 15 04:17:16 2005