bpo-37219: Remove erroneous optimization for differencing an empty set (GH-13965)

This commit is contained in:
Raymond Hettinger 2019-06-11 01:15:24 -07:00 committed by GitHub
parent 408a2ef1ac
commit 1f11cf9521
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 8 deletions

View file

@ -895,6 +895,12 @@ def test_pickling(self):
self.assertEqual(self.set, copy,
"%s != %s" % (self.set, copy))
def test_issue_37219(self):
with self.assertRaises(TypeError):
set().difference(123)
with self.assertRaises(TypeError):
set().difference_update(123)
#------------------------------------------------------------------------------
class TestBasicOpsEmpty(TestBasicOps, unittest.TestCase):