1.1 --- a/lib/__builtins__/int.py Thu Mar 23 16:40:57 2017 +0100
1.2 +++ b/lib/__builtins__/int.py Thu Mar 23 23:36:32 2017 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Integer objects.
1.6
1.7 -Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -34,11 +34,9 @@
1.13
1.14 "Initialise the integer with the given 'number_or_string'."
1.15
1.16 - if _isinstance(number_or_string, int):
1.17 - self.__data__ = number_or_string.__data__
1.18 - else:
1.19 - # NOTE: To be implemented.
1.20 - self.__data__ = None
1.21 + # NOTE: To be implemented.
1.22 +
1.23 + pass
1.24
1.25 def __hash__(self):
1.26
1.27 @@ -51,7 +49,7 @@
1.28 "Perform 'op' on this int and 'other' if appropriate."
1.29
1.30 if _isinstance(other, int):
1.31 - return op(self.__data__, other.__data__)
1.32 + return op(self, other)
1.33 else:
1.34 return NotImplemented
1.35
1.36 @@ -60,7 +58,7 @@
1.37 "Perform 'op' on 'other' and this int if appropriate."
1.38
1.39 if _isinstance(other, int):
1.40 - return op(other.__data__, self.__data__)
1.41 + return op(other, self)
1.42 else:
1.43 return NotImplemented
1.44
1.45 @@ -122,7 +120,7 @@
1.46
1.47 "Return the inversion of this int."
1.48
1.49 - return int_not(self.__data__)
1.50 + return int_not(self)
1.51
1.52 __add__ = __radd__ = __iadd__
1.53 __sub__ = __isub__
1.54 @@ -206,7 +204,7 @@
1.55
1.56 "Apply the unary negation operator."
1.57
1.58 - return int_neg(self.__data__)
1.59 + return int_neg(self)
1.60
1.61 def __pos__(self):
1.62
1.63 @@ -218,7 +216,7 @@
1.64
1.65 "Return a string representation."
1.66
1.67 - return utf8string(int_str(self.__data__))
1.68 + return utf8string(int_str(self))
1.69
1.70 __repr__ = __str__
1.71
1.72 @@ -233,8 +231,7 @@
1.73
1.74 "Return whether this int is non-zero."
1.75
1.76 - zero = 0
1.77 - return int_ne(self.__data__, zero.__data__)
1.78 + return int_ne(self, 0)
1.79
1.80 # Limits.
1.81