diff options
| author | Rupert Tombs <rupert.tombs@gmail.com> | 2021-07-07 13:28:09 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-07 13:28:09 (GMT) |
| commit | 6bd3ecfc272b122b55a6adec50dd7a7c868f262f (patch) | |
| tree | ad92100dff9d7506a6499f0e8fb18b74111a3e80 /Lib/test/test_operator.py | |
| parent | 8363c53369a582ff9ae4e797a80cdce12624a278 (diff) | |
| download | cpython-6bd3ecfc272b122b55a6adec50dd7a7c868f262f.zip cpython-6bd3ecfc272b122b55a6adec50dd7a7c868f262f.tar.gz cpython-6bd3ecfc272b122b55a6adec50dd7a7c868f262f.tar.bz2 | |
bpo-44558: Match countOf `is`/`==` treatment to c (GH-27007)
Diffstat (limited to 'Lib/test/test_operator.py')
| -rw-r--r-- | Lib/test/test_operator.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py index d50306b..b9b8f15 100644 --- a/Lib/test/test_operator.py +++ b/Lib/test/test_operator.py @@ -153,6 +153,11 @@ class OperatorTestCase: self.assertRaises(ZeroDivisionError, operator.countOf, BadIterable(), 1) self.assertEqual(operator.countOf([1, 2, 1, 3, 1, 4], 3), 1) self.assertEqual(operator.countOf([1, 2, 1, 3, 1, 4], 5), 0) + # is but not == + nan = float("nan") + self.assertEqual(operator.countOf([nan, nan, 21], nan), 2) + # == but not is + self.assertEqual(operator.countOf([{}, 1, {}, 2], {}), 2) def test_delitem(self): operator = self.module |
