Re: [Python-Dev] Identity implies equality

2011-04-28 Thread Laurens Van Houtven
On Thu, Apr 28, 2011 at 9:51 PM, Raymond Hettinger 
raymond.hettin...@gmail.com wrote:

 Personally, I think the status quo is fine
 and that practicality is beating purity.


+1



 Raymond


cheers
lvh
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Identity implies equality

2011-04-28 Thread Nick Coghlan
On Fri, Apr 29, 2011 at 5:51 AM, Raymond Hettinger
raymond.hettin...@gmail.com wrote:
 *  x = obj implies x == obj   # assignment really works

While I agree with your point of view regarding the status quo as a
useful, practical compromise, I need to call out that particular
example:

 nan = float('nan')
 x = nan
 x == nan
False
 x in locals().values()
True

Due to rich comparison and the freedom to implement non-reflexive
definitions of equality, the assignment x = obj implies only that:
- x is obj
- x in locals().values()

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com