1.1 --- a/lib/__builtins__/int.py Wed Jul 11 18:33:51 2018 +0200
1.2 +++ b/lib/__builtins__/int.py Wed Jul 11 23:52:05 2018 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Integer objects.
1.6
1.7 -Copyright (C) 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2015, 2016, 2017, 2018 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 @@ -19,12 +19,12 @@
1.13 this program. If not, see <http://www.gnu.org/licenses/>.
1.14 """
1.15
1.16 -from __builtins__.operator import _negate
1.17 from __builtins__.unicode import utf8string
1.18 from native import get_maxint, get_minint, is_int, \
1.19 - int_add, int_and, int_div, int_eq, int_gt, int_lshift, \
1.20 - int_lt, int_mod, int_mul, int_ne, int_neg, int_not, \
1.21 - int_or, int_pow, int_rshift, int_str, int_sub, int_xor
1.22 + int_add, int_and, int_div, int_eq, int_ge, int_gt, \
1.23 + int_lshift, int_le, int_lt, int_mod, int_mul, int_ne, \
1.24 + int_neg, int_not, int_or, int_pow, int_rshift, int_str, \
1.25 + int_sub, int_xor
1.26
1.27 class int:
1.28
1.29 @@ -140,6 +140,8 @@
1.30
1.31 return self._binary_op_rev(int_div, other)
1.32
1.33 + # NOTE: To be implemented.
1.34 +
1.35 def __floordiv__(self, other): pass
1.36 def __rfloordiv__(self, other): pass
1.37 def __ifloordiv__(self, other): pass
1.38 @@ -189,7 +191,6 @@
1.39 return self._binary_op_rev(int_rshift, other)
1.40
1.41 __ilshift__ = __lshift__
1.42 -
1.43 __irshift__ = __rshift__
1.44
1.45 def __lt__(self, other):
1.46 @@ -208,13 +209,13 @@
1.47
1.48 "Return whether this int is less than or equal to 'other'."
1.49
1.50 - return _negate(self.__gt__(other))
1.51 + return self._binary_op(int_le, other)
1.52
1.53 def __ge__(self, other):
1.54
1.55 "Return whether this int is greater than or equal to 'other'."
1.56
1.57 - return _negate(self.__lt__(other))
1.58 + return self._binary_op(int_ge, other)
1.59
1.60 def __eq__(self, other):
1.61
1.62 @@ -226,7 +227,7 @@
1.63
1.64 "Return whether this int is not equal to 'other'."
1.65
1.66 - return _negate(self.__eq__(other))
1.67 + return self._binary_op(int_ne, other)
1.68
1.69 def __neg__(self):
1.70