1.1 --- a/lib/builtins.py Sat Sep 04 00:55:37 2010 +0200
1.2 +++ b/lib/builtins.py Sun Sep 05 02:20:05 2010 +0200
1.3 @@ -292,11 +292,13 @@
1.4
1.5 "Implementation of xrange."
1.6
1.7 - def __init__(self, start_or_end, end=None, step=1):
1.8 + NO_END = object()
1.9 +
1.10 + def __init__(self, start_or_end, end=NO_END, step=1):
1.11
1.12 "Initialise the xrange with the given 'start_or_end', 'end' and 'step'."
1.13
1.14 - if end is None:
1.15 + if end is xrange.NO_END:
1.16 self.start = 0
1.17 self.end = start_or_end
1.18 else:
1.19 @@ -305,7 +307,7 @@
1.20
1.21 self.step = step
1.22 self.current = self.start
1.23 - self.limited = self.end is not None
1.24 + self.limited = self.end is not xrange.NO_END
1.25
1.26 def __iter__(self):
1.27
1.28 @@ -329,7 +331,7 @@
1.29
1.30 "Implementation of slice."
1.31
1.32 - def __init__(self, start_or_end=None, end=None, step=1):
1.33 + def __init__(self, start_or_end=None, end=xrange.NO_END, step=1):
1.34
1.35 "Initialise the slice with the given 'start_or_end', 'end' and 'step'."
1.36