[New-bugs-announce] [issue24410] set.__eq__ returns False when it should return NotImplemented

Steve Zelaznik report at bugs.python.org
Mon Jun 8 17:50:47 CEST 2015


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 <report at bugs.python.org>
<http://bugs.python.org/issue24410>
_______________________________________


More information about the New-bugs-announce mailing list