[issue37219] empty set difference does not check types of values

Anthony Sottile report at bugs.python.org
Mon Jun 10 18:01:36 EDT 2019


New submission from Anthony Sottile <asottile at umich.edu>:

This is a regression from python2.x behaviour:

$ python2
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = set()
>>> x.difference(123)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable


$ python3.8
Python 3.8.0b1 (default, Jun  6 2019, 03:44:52) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = set()
>>> x.difference(123)
set()

The regression appears to be introduced in this patch: 4103e4dfbce

https://github.com/python/cpython/commit/4103e4dfbce

----------
components: Library (Lib)
messages: 345147
nosy: Anthony Sottile, rhettinger
priority: normal
severity: normal
status: open
title: empty set difference does not check types of values
versions: Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37219>
_______________________________________


More information about the Python-bugs-list mailing list