mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
Make reversed() transparent with respect to length.
This commit is contained in:
parent
5cab2e3a88
commit
029dba5a40
2 changed files with 17 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue