mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +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 @@ def test_double_reverse(self):
|
|||
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