[issue24410] set.__eq__ returns False when it should return NotImplemented

2015-06-08 Thread Steve Zelaznik

New submission from Steve Zelaznik:

[in] >>> d = {'x':3,'y':4,'z':5}
  [in] >>> set(d.items()) == d.viewitems()
 [out] >>> False
  [in] >>> d.viewitems() == set(d.items())
 [out] >>> True
  [in] >>> set(d.items()).__eq__(d.viewitems())
 [out] >>> False

The last line should return NotImplemented rather than False.  This problem 
seems to have been addressed in Python3.

--
components: Build
messages: 245009
nosy: zelaznik
priority: normal
severity: normal
status: open
title: set.__eq__ returns False when it should return NotImplemented
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue24410>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24410] set.__eq__ returns False when it should return NotImplemented

2015-06-08 Thread Steve Zelaznik

Steve Zelaznik added the comment:

On second thought, it looks like somebody may have caught the problem at or 
before Python 2.7.9.

My PC at work has 2.7.6 which is where I spotted the problem.  My mac at home 
has 2.7.9 where it worked fine.

Steve Zelaznik
410.375.8414
Sent from either an
iPhone or an Android

> On Jun 8, 2015, at 1:07 PM, R. David Murray  wrote:
> 
> 
> R. David Murray added the comment:
> 
> See issue 21408 for the fix, which was indeed not applied to 2.7.  Now we get 
> to decide if it should be :)
> 
> --
> nosy: +r.david.murray
> 
> ___
> Python tracker 
> <http://bugs.python.org/issue24410>
> ___

--

___
Python tracker 
<http://bugs.python.org/issue24410>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com