Removed utils.iter.one, which was dumb, because iterators have a .next() method that does the same thing.

This commit is contained in:
Jeremy Fincher 2005-07-08 09:14:45 +00:00
parent 6f8e3d37aa
commit 5b8400e158
2 changed files with 0 additions and 13 deletions

View File

@ -148,11 +148,6 @@ def ilen(iterable):
i += 1
return i
def one(iterable):
for x in iterable:
return x
raise ValueError, 'Empty iterable: %r' % iterable
def startswith(long, short):
longI = iter(long)
shortI = iter(short)

View File

@ -384,14 +384,6 @@ class StrTest(SupyTestCase):
class IterTest(SupyTestCase):
def testOne(self):
L = range(3)
i = iter(L)
self.assertEqual(utils.iter.one(i), 0)
self.assertEqual(utils.iter.one(i), 1)
self.assertEqual(utils.iter.one(i), 2)
self.assertRaises(ValueError, utils.iter.one, i)
def testLimited(self):
L = range(10)
self.assertEqual([], list(utils.iter.limited(L, 0)))