1.1 --- a/lib/builtins.py Sun Feb 18 00:50:52 2007 +0100
1.2 +++ b/lib/builtins.py Sun Feb 18 01:39:11 2007 +0100
1.3 @@ -74,6 +74,9 @@
1.4 class float:
1.5 __atomic__ = 1
1.6
1.7 + def __init__(self, number_or_string=None):
1.8 + pass
1.9 +
1.10 def __iadd__(self, other):
1.11 if isinstance(other, int):
1.12 return float()
1.13 @@ -289,6 +292,9 @@
1.14 class int:
1.15 __atomic__ = 1
1.16
1.17 + def __init__(self, number_or_string=None):
1.18 + pass
1.19 +
1.20 def __iadd__(self, other):
1.21 if isinstance(other, int):
1.22 return int()
1.23 @@ -485,6 +491,9 @@
1.24 class long:
1.25 __atomic__ = 1
1.26
1.27 + def __init__(self, number_or_string=None):
1.28 + pass
1.29 +
1.30 def __iadd__(self, other):
1.31 if isinstance(other, int):
1.32 return long()
1.33 @@ -620,6 +629,12 @@
1.34 else:
1.35 raise TypeError
1.36
1.37 + def __mod__(self, other):
1.38 +
1.39 + "The format operator for strings."
1.40 +
1.41 + return str()
1.42 +
1.43 def __len__(self):
1.44 return int()
1.45
1.46 @@ -716,11 +731,15 @@
1.47 return bool()
1.48
1.49 class xrange:
1.50 - def __init__(self, start, end, step=1):
1.51 - self.start = start
1.52 - self.end = end
1.53 + def __init__(self, start_or_end, end=None, step=1):
1.54 + if end is None:
1.55 + self.start = 0
1.56 + self.end = start_or_end
1.57 + else:
1.58 + self.start = start_or_end
1.59 + self.end = end
1.60 self.step = step
1.61 - self.current = start
1.62 + self.current = self.start
1.63
1.64 def __iter__(self):
1.65 return self