mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Let reversed() work with itself.
This commit is contained in:
parent
8a1a594590
commit
06353f76be
3 changed files with 17 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue