1.1 --- a/lib/__builtins__/int.py Fri Dec 09 00:09:01 2016 +0100
1.2 +++ b/lib/__builtins__/int.py Fri Dec 09 16:22:37 2016 +0100
1.3 @@ -30,7 +30,7 @@
1.4
1.5 "Initialise the integer with the given 'number_or_string'."
1.6
1.7 - if native._isinstance(number_or_string, int):
1.8 + if native.isinstance(number_or_string, int):
1.9 self.__data__ = number_or_string.__data__
1.10 else:
1.11 # NOTE: To be implemented.
1.12 @@ -46,7 +46,7 @@
1.13
1.14 "Perform 'op' on this int and 'other' if appropriate."
1.15
1.16 - if native._isinstance(other, int):
1.17 + if native.isinstance(other, int):
1.18 return op(self.__data__, other.__data__)
1.19 else:
1.20 return NotImplemented
1.21 @@ -55,7 +55,7 @@
1.22
1.23 "Perform 'op' on 'other' and this int if appropriate."
1.24
1.25 - if native._isinstance(other, int):
1.26 + if native.isinstance(other, int):
1.27 return op(other.__data__, self.__data__)
1.28 else:
1.29 return NotImplemented
1.30 @@ -64,61 +64,61 @@
1.31
1.32 "Return a new int for the addition of this int and 'other'."
1.33
1.34 - return self._binary_op(native._int_add, other)
1.35 + return self._binary_op(native.int_add, other)
1.36
1.37 def __isub__(self, other):
1.38
1.39 "Return a new int for the subtraction of this int and 'other'."
1.40
1.41 - return self._binary_op(native._int_sub, other)
1.42 + return self._binary_op(native.int_sub, other)
1.43
1.44 def __imul__(self, other):
1.45
1.46 "Return a new int for the multiplication of this int and 'other'."
1.47
1.48 - return self._binary_op(native._int_mul, other)
1.49 + return self._binary_op(native.int_mul, other)
1.50
1.51 def __idiv__(self, other):
1.52
1.53 "Return a new int for the division of this int and 'other'."
1.54
1.55 - return self._binary_op(native._int_div, other)
1.56 + return self._binary_op(native.int_div, other)
1.57
1.58 def __imod__(self, other):
1.59
1.60 "Return a new int for the modulo of this int by 'other'."
1.61
1.62 - return self._binary_op(native._int_mod, other)
1.63 + return self._binary_op(native.int_mod, other)
1.64
1.65 def __ipow__(self, other):
1.66
1.67 "Return a new int for the exponentiation of this int by 'other'."
1.68
1.69 - return self._binary_op(native._int_pow, other)
1.70 + return self._binary_op(native.int_pow, other)
1.71
1.72 def __iand__(self, other):
1.73
1.74 "Return a new int for the binary-and of this int and 'other'."
1.75
1.76 - return self._binary_op(native._int_and, other)
1.77 + return self._binary_op(native.int_and, other)
1.78
1.79 def __ior__(self, other):
1.80
1.81 "Return a new int for the binary-or of this int and 'other'."
1.82
1.83 - return self._binary_op(native._int_or, other)
1.84 + return self._binary_op(native.int_or, other)
1.85
1.86 def __ixor__(self, other):
1.87
1.88 "Return a new int for the exclusive-or of this int and 'other'."
1.89
1.90 - return self._binary_op(native._int_xor, other)
1.91 + return self._binary_op(native.int_xor, other)
1.92
1.93 def __invert__(self):
1.94
1.95 "Return the inversion of this int."
1.96
1.97 - return native._int_not(self.__data__)
1.98 + return native.int_not(self.__data__)
1.99
1.100 __add__ = __radd__ = __iadd__
1.101 __sub__ = __isub__
1.102 @@ -127,7 +127,7 @@
1.103
1.104 "Return a new int for the subtraction of this int from 'other'."
1.105
1.106 - return self._binary_op_rev(native._int_sub, other)
1.107 + return self._binary_op_rev(native.int_sub, other)
1.108
1.109 __mul__ = __rmul__ = __imul__
1.110 __div__ = __idiv__
1.111 @@ -136,7 +136,7 @@
1.112
1.113 "Return a new int for the division of this int into 'other'."
1.114
1.115 - return self._binary_op_rev(native._int_div, other)
1.116 + return self._binary_op_rev(native.int_div, other)
1.117
1.118 def __floordiv__(self, other): pass
1.119 def __rfloordiv__(self, other): pass
1.120 @@ -148,7 +148,7 @@
1.121
1.122 "Return a new int for the modulo of 'other' by this int."
1.123
1.124 - return self._binary_op_rev(native._int_mod, other)
1.125 + return self._binary_op_rev(native.int_mod, other)
1.126
1.127 __pow__ = __ipow__
1.128
1.129 @@ -156,7 +156,7 @@
1.130
1.131 "Return a new int for the exponentiation of 'other' by this int."
1.132
1.133 - return self._binary_op_rev(native._int_pow, other)
1.134 + return self._binary_op_rev(native.int_pow, other)
1.135
1.136 __and__ = __rand__ = __iand__
1.137 __or__ = __ror__ = __ior__
1.138 @@ -166,13 +166,13 @@
1.139
1.140 "Return whether this int is less than 'other'."
1.141
1.142 - return self._binary_op(native._int_lt, other)
1.143 + return self._binary_op(native.int_lt, other)
1.144
1.145 def __gt__(self, other):
1.146
1.147 "Return whether this int is greater than 'other'."
1.148
1.149 - return self._binary_op(native._int_gt, other)
1.150 + return self._binary_op(native.int_gt, other)
1.151
1.152 def __le__(self, other):
1.153
1.154 @@ -190,7 +190,7 @@
1.155
1.156 "Return whether this int is equal to 'other'."
1.157
1.158 - return self._binary_op(native._int_eq, other)
1.159 + return self._binary_op(native.int_eq, other)
1.160
1.161 def __ne__(self, other):
1.162
1.163 @@ -202,7 +202,7 @@
1.164
1.165 "Apply the unary negation operator."
1.166
1.167 - return native._int_neg(self.__data__)
1.168 + return native.int_neg(self.__data__)
1.169
1.170 def __pos__(self):
1.171
1.172 @@ -214,7 +214,7 @@
1.173
1.174 "Return a string representation."
1.175
1.176 - return native._int_str(self.__data__)
1.177 + return native.int_str(self.__data__)
1.178
1.179 __repr__ = __str__
1.180
1.181 @@ -230,11 +230,11 @@
1.182 "Return whether this int is non-zero."
1.183
1.184 zero = 0
1.185 - return native._int_ne(self.__data__, zero.__data__)
1.186 + return native.int_ne(self.__data__, zero.__data__)
1.187
1.188 # Limits.
1.189
1.190 -maxint = native._get_maxint()
1.191 -minint = native._get_minint()
1.192 +maxint = native.get_maxint()
1.193 +minint = native.get_minint()
1.194
1.195 # vim: tabstop=4 expandtab shiftwidth=4