summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_enumerate.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-02-08 10:49:42 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-02-08 10:49:42 (GMT)
commit06353f76beab69a538d3a55ca9b6df7e9754b999 (patch)
tree3d0caeac4f7b271d32c35333a6b4f47baedbfa46 /Lib/test/test_enumerate.py
parent8a1a5945908c7a0b2b487a98431ff46ab934014a (diff)
downloadcpython-06353f76beab69a538d3a55ca9b6df7e9754b999.zip
cpython-06353f76beab69a538d3a55ca9b6df7e9754b999.tar.gz
cpython-06353f76beab69a538d3a55ca9b6df7e9754b999.tar.bz2
Let reversed() work with itself.
Diffstat (limited to 'Lib/test/test_enumerate.py')
-rw-r--r--Lib/test/test_enumerate.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_enumerate.py b/Lib/test/test_enumerate.py
index 636f883..ab1a60d 100644
--- a/Lib/test/test_enumerate.py
+++ b/Lib/test/test_enumerate.py
@@ -141,6 +141,10 @@ class TestReversed(unittest.TestCase):
x = xrange(1)
self.assertEqual(type(reversed(x)), type(iter(x)))
+ def test_double_reverse(self):
+ s = 'hello'
+ self.assertEqual(list(reversed(reversed(s))), list(s))
+
def test_main(verbose=None):
testclasses = (EnumerateTestCase, SubclassTestCase, TestEmpty, TestBig,
TestReversed)