1.1 --- a/lib/builtins.py Wed Sep 30 00:24:41 2009 +0200
1.2 +++ b/lib/builtins.py Wed Sep 30 00:53:07 2009 +0200
1.3 @@ -163,8 +163,26 @@
1.4 return listiterator(self)
1.5
1.6 class listiterator(object):
1.7 - def __init__(self, l): pass
1.8 - def next(self): pass
1.9 +
1.10 + "Implementation of listiterator."
1.11 +
1.12 + def __init__(self, l):
1.13 +
1.14 + "Initialise with the given list 'l'."
1.15 +
1.16 + self.l = l
1.17 + self.i = 0
1.18 +
1.19 + def next(self):
1.20 +
1.21 + "Return the next item."
1.22 +
1.23 + try:
1.24 + value = self.l[self.i]
1.25 + self.i += 1
1.26 + return value
1.27 + except IndexError:
1.28 + raise StopIteration
1.29
1.30 class long(object):
1.31 def __init__(self, number_or_string=None): pass