summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-02-10 09:33:39 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-02-10 09:33:39 (GMT)
commit029dba5a4078bc1e9dc262d24aaa481936af49d3 (patch)
treeedd2a1b4e38130d66c90a6909239e22851676472 /Lib
parent5cab2e3a88903b0cea558ee01b8f5b9e5a31a797 (diff)
downloadcpython-029dba5a4078bc1e9dc262d24aaa481936af49d3.zip
cpython-029dba5a4078bc1e9dc262d24aaa481936af49d3.tar.gz
cpython-029dba5a4078bc1e9dc262d24aaa481936af49d3.tar.bz2
Make reversed() transparent with respect to length.
Diffstat (limited to 'Lib')
-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 ab1a60d..00ecbcc 100644
--- a/Lib/test/test_enumerate.py
+++ b/Lib/test/test_enumerate.py
@@ -145,6 +145,10 @@ class TestReversed(unittest.TestCase):
s = 'hello'
self.assertEqual(list(reversed(reversed(s))), list(s))
+ def test_len(self):
+ s = 'hello'
+ self.assertEqual(len(reversed(s)), len(s))
+
def test_main(verbose=None):
testclasses = (EnumerateTestCase, SubclassTestCase, TestEmpty, TestBig,
TestReversed)