[issue28189] dictitems_contains swallows compare errors

2016-09-18 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for the merge Raymond. :)

--
stage: patch review -> resolved

___
Python tracker 

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



[issue28189] dictitems_contains swallows compare errors

2016-09-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks for the patch.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28189] dictitems_contains swallows compare errors

2016-09-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2a9e0e869ca7 by Raymond Hettinger in branch '3.5':
Issue #28189: dictitems_contains no longer swallows compare errors.
https://hg.python.org/cpython/rev/2a9e0e869ca7

--
nosy: +python-dev

___
Python tracker 

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



[issue28189] dictitems_contains swallows compare errors

2016-09-18 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue28189] dictitems_contains swallows compare errors

2016-09-17 Thread Xiang Zhang

New submission from Xiang Zhang:

Now, when compare errors raised during `in`, dict.keys(), dict.values() and set 
all propagate the errors. But dict.items() will swallow the errors(only key 
compare):

>>> class BadEq:
... def __hash__(self):
... return 7
... def __eq__(self, other):
... raise RuntimeError
... 
>>> k1, k2, v1, v2 = BadEq(), BadEq(), BadEq(), BadEq()
>>> d = {k1: v1}
>>> k2 in d.keys()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in __eq__
RuntimeError
>>> v2 in d.values()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in __eq__
RuntimeError
>>> k2 in {k1}
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in __eq__
RuntimeError
>>> (k2, v2) in d.items()
False
>>> (k2, v1) in d.items()
False

dictitems_contains.patch tries to fix this.

--
components: Interpreter Core
files: dictitems_contains.patch
keywords: patch
messages: 276801
nosy: haypo, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: dictitems_contains swallows compare errors
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44717/dictitems_contains.patch

___
Python tracker 

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