mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Convert iterator __len__() methods to a private API.
This commit is contained in:
parent
9ceebd5445
commit
6b27cda643
16 changed files with 169 additions and 94 deletions
|
@ -144,6 +144,7 @@ class TestReversed(unittest.TestCase):
|
|||
|
||||
def test_len(self):
|
||||
# This is an implementation detail, not an interface requirement
|
||||
from test.test_iterlen import len
|
||||
for s in ('hello', tuple('hello'), list('hello'), xrange(5)):
|
||||
self.assertEqual(len(reversed(s)), len(s))
|
||||
r = reversed(s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue