Convert iterator __len__() methods to a private API.

This commit is contained in:
Raymond Hettinger 2005-09-24 21:23:05 +00:00
parent 9ceebd5445
commit 6b27cda643
16 changed files with 169 additions and 94 deletions

View file

@ -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)