mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Don't allow keyword arguments to reversed().
This commit is contained in:
parent
88107dafef
commit
ecf9091f59
2 changed files with 6 additions and 1 deletions
|
@ -138,6 +138,8 @@ class TestReversed(unittest.TestCase):
|
|||
for data in 'abc', range(5), tuple(enumerate('abc')), A(), xrange(1,17,5):
|
||||
self.assertEqual(list(data)[::-1], list(reversed(data)))
|
||||
self.assertRaises(TypeError, reversed, {})
|
||||
# don't allow keyword arguments
|
||||
self.assertRaises(TypeError, reversed, [], a=1)
|
||||
|
||||
def test_xrange_optimization(self):
|
||||
x = xrange(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue