summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_operator.py
diff options
context:
space:
mode:
authorStefan Pochmann <609905+pochmann@users.noreply.github.com>2023-03-02 03:16:23 (GMT)
committerGitHub <noreply@github.com>2023-03-02 03:16:23 (GMT)
commiteaae563b6878aa050b4ad406b67728b6b066220e (patch)
treeb1bd7d9491f50264244b8a3f5f3eda0e32d78687 /Lib/test/test_operator.py
parent2f62a5da949cd368a9498e6a03e700f4629fa97f (diff)
downloadcpython-eaae563b6878aa050b4ad406b67728b6b066220e.zip
cpython-eaae563b6878aa050b4ad406b67728b6b066220e.tar.gz
cpython-eaae563b6878aa050b4ad406b67728b6b066220e.tar.bz2
gh-102088 Optimize iter_index itertools recipe (GH-102360)
Diffstat (limited to 'Lib/test/test_operator.py')
-rw-r--r--Lib/test/test_operator.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py
index b7e38c2..1db738d 100644
--- a/Lib/test/test_operator.py
+++ b/Lib/test/test_operator.py
@@ -208,6 +208,9 @@ class OperatorTestCase:
nan = float("nan")
self.assertEqual(operator.indexOf([nan, nan, 21], nan), 0)
self.assertEqual(operator.indexOf([{}, 1, {}, 2], {}), 0)
+ it = iter('leave the iterator at exactly the position after the match')
+ self.assertEqual(operator.indexOf(it, 'a'), 2)
+ self.assertEqual(next(it), 'v')
def test_invert(self):
operator = self.module