1.1 --- a/TO_DO.txt Mon Jun 13 00:18:13 2011 +0200
1.2 +++ b/TO_DO.txt Mon Jun 13 20:59:00 2011 +0200
1.3 @@ -18,6 +18,13 @@
1.4
1.5 Update docs/assignment.txt.
1.6
1.7 +Prevent assignments within classes, such as method aliasing, from causing the source of an
1.8 +assignment from being automatically generated. Instead, only external references should be
1.9 +registered.
1.10 +
1.11 +Prevent "from <module> import ..." statements from registering references to such local
1.12 +aliases such that they cause the source of each alias to be automatically generated.
1.13 +
1.14 Consider attribute assignment observations, along with the possibility of class and module
1.15 attribute assignment.
1.16
2.1 --- a/lib/builtins.py Mon Jun 13 00:18:13 2011 +0200
2.2 +++ b/lib/builtins.py Mon Jun 13 20:59:00 2011 +0200
2.3 @@ -1,9 +1,7 @@
2.4 #!/usr/bin/env python
2.5
2.6 """
2.7 -Simple built-in classes and functions. Objects which provide code that shall
2.8 -always be compiled should provide docstrings. Objects without code should be
2.9 -provided by native library code.
2.10 +Simple built-in classes and functions.
2.11
2.12 Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Paul Boddie <paul@boddie.org.uk>
2.13
2.14 @@ -19,10 +17,24 @@
2.15
2.16 You should have received a copy of the GNU General Public License along with
2.17 this program. If not, see <http://www.gnu.org/licenses/>.
2.18 +
2.19 +--------
2.20 +
2.21 +Objects which provide code that shall always be compiled should provide
2.22 +docstrings. Objects without code should be provided by native library code.
2.23 +
2.24 +Classes without docstrings do not have instantiators generated for them.
2.25 +
2.26 +Methods defined in classes are generated if they have docstrings, regardless of
2.27 +whether their classes have docstrings.
2.28 """
2.29
2.30 +import native
2.31 +
2.32 class object:
2.33 - def __init__(self): pass
2.34 + def __init__(self):
2.35 + "No-operation."
2.36 + pass
2.37 def __bool__(self): pass
2.38
2.39 class basestring(object):
2.40 @@ -34,29 +46,57 @@
2.41 IndexError
2.42
2.43 def __getslice__(self, start, end=None): pass
2.44 - def __iadd__(self, other): pass
2.45 - def __add__(self, other): pass
2.46 - def __radd__(self, other): pass
2.47 +
2.48 + def __iadd__(self, other):
2.49 + "Return a new string for the operation."
2.50 + return _binary_op(self, other, native._str_add)
2.51 +
2.52 + __add__ = __radd__ = __iadd__
2.53 +
2.54 def __mul__(self, other): pass
2.55 def __rmul__(self, other): pass
2.56 def __mod__(self, other): pass
2.57 def __rmod__(self, other): pass
2.58 - def __lt__(self, other): pass
2.59 - def __gt__(self, other): pass
2.60 - def __le__(self, other): pass
2.61 - def __ge__(self, other): pass
2.62 - def __eq__(self, other): pass
2.63 - def __ne__(self, other): pass
2.64 +
2.65 + def __lt__(self, other):
2.66 + "Return a new boolean for the comparison."
2.67 + return _binary_op(self, other, native._str_lt)
2.68 +
2.69 + def __gt__(self, other):
2.70 + "Return a new boolean for the comparison."
2.71 + return _binary_op(self, other, native._str_gt)
2.72 +
2.73 + def __le__(self, other):
2.74 + "Return a new boolean for the comparison."
2.75 + return not self.__gt__(other)
2.76 +
2.77 + def __ge__(self, other):
2.78 + "Return a new boolean for the comparison."
2.79 + return not self.__lt__(other)
2.80 +
2.81 + def __eq__(self, other):
2.82 + "Return a new boolean for the comparison."
2.83 + return _binary_op(self, other, native._str_eq)
2.84 +
2.85 + def __ne__(self, other):
2.86 + "Return a new boolean for the comparison."
2.87 + return not self.__eq__(other)
2.88 +
2.89 def __len__(self): pass
2.90 def __str__(self): pass
2.91 - def __bool__(self): pass
2.92 +
2.93 + def __bool__(self):
2.94 + return not native._str_eq(self, "")
2.95 +
2.96 def join(self, l): pass
2.97 def split(self, s): pass
2.98 def startswith(self, s): pass
2.99 def endswith(self, s): pass
2.100
2.101 class bool(object):
2.102 - def __bool__(self): pass
2.103 + def __bool__(self):
2.104 + "Identity operation."
2.105 + return self
2.106 def __str__(self): pass
2.107
2.108 class buffer(object):
2.109 @@ -117,45 +157,112 @@
2.110
2.111 class int(object):
2.112 def __init__(self, number_or_string=None): pass
2.113 - def __iadd__(self, other): pass
2.114 - def __isub__(self, other): pass
2.115 - def __iand__(self, other): pass
2.116 - def __ior__(self, other): pass
2.117 - def __add__(self, other): pass
2.118 - def __radd__(self, other): pass
2.119 - def __sub__(self, other): pass
2.120 - def __rsub__(self, other): pass
2.121 - def __mul__(self, other): pass
2.122 - def __rmul__(self, other): pass
2.123 - def __div__(self, other): pass
2.124 - def __rdiv__(self, other): pass
2.125 +
2.126 + def __iadd__(self, other):
2.127 + "Return a new int for the operation."
2.128 + return _binary_op(self, other, native._int_add)
2.129 +
2.130 + def __isub__(self, other):
2.131 + "Return a new int for the operation."
2.132 + return _binary_op(self, other, native._int_sub)
2.133 +
2.134 + def __imul__(self, other):
2.135 + "Return a new int for the operation."
2.136 + return _binary_op(self, other, native._int_mul)
2.137 +
2.138 + def __idiv__(self, other):
2.139 + "Return a new int for the operation."
2.140 + return _binary_op(self, other, native._int_div)
2.141 +
2.142 + def __imod__(self, other):
2.143 + "Return a new int for the operation."
2.144 + return _binary_op(self, other, native._int_mod)
2.145 +
2.146 + def __ipow__(self, other):
2.147 + "Return a new int for the operation."
2.148 + return _binary_op(self, other, native._int_pow)
2.149 +
2.150 + def __iand__(self, other):
2.151 + "Return a new int for the operation."
2.152 + return _binary_op(self, other, native._int_and)
2.153 +
2.154 + def __ior__(self, other):
2.155 + "Return a new int for the operation."
2.156 + return _binary_op(self, other, native._int_or)
2.157 +
2.158 + def __ixor__(self, other):
2.159 + "Return a new int for the operation."
2.160 + return _binary_op(self, other, native._int_xor)
2.161 +
2.162 + __add__ = __radd__ = __iadd__
2.163 + __sub__ = __isub__
2.164 +
2.165 + def __rsub__(self, other):
2.166 + "Return a new int for the operation."
2.167 + return _binary_op(self, other, native._int_rsub)
2.168 +
2.169 + __mul__ = __rmul__ = __imul__
2.170 + __div__ = __idiv__
2.171 +
2.172 + def __rdiv__(self, other):
2.173 + "Return a new int for the operation."
2.174 + return _binary_op(self, other, native._int_rdiv)
2.175 +
2.176 def __floordiv__(self, other): pass
2.177 def __rfloordiv__(self, other): pass
2.178 - def __mod__(self, other): pass
2.179 - def __rmod__(self, other): pass
2.180 - def __pow__(self, other): pass
2.181 - def __rpow__(self, other): pass
2.182 - def __and__(self, other): pass
2.183 - def __rand__(self, other): pass
2.184 - def __or__(self, other): pass
2.185 - def __ror__(self, other): pass
2.186 - def __xor__(self, other): pass
2.187 - def __rxor__(self, other): pass
2.188 - def __lt__(self, other): pass
2.189 - def __gt__(self, other): pass
2.190 - def __le__(self, other): pass
2.191 - def __ge__(self, other): pass
2.192 - def __eq__(self, other): pass
2.193 - def __ne__(self, other): pass
2.194 +
2.195 + __mod__ = __imod__
2.196 +
2.197 + def __rmod__(self, other):
2.198 + "Return a new int for the operation."
2.199 + return _binary_op(self, other, native._int_rmod)
2.200 +
2.201 + __pow__ = __ipow__
2.202 +
2.203 + def __rpow__(self, other):
2.204 + "Return a new int for the operation."
2.205 + return _binary_op(self, other, native._int_rpow)
2.206 +
2.207 + __and__ = __rand__ = __iand__
2.208 + __or__ = __ror__ = __ior__
2.209 + __xor__ = __rxor__ = __ixor__
2.210 +
2.211 + def __lt__(self, other):
2.212 + "Return a new boolean for the comparison."
2.213 + return _binary_op(self, other, native._int_lt)
2.214 +
2.215 + def __gt__(self, other):
2.216 + "Return a new boolean for the comparison."
2.217 + return _binary_op(self, other, native._int_gt)
2.218 +
2.219 + def __le__(self, other):
2.220 + "Return a new boolean for the comparison."
2.221 + return not self.__gt__(other)
2.222 +
2.223 + def __ge__(self, other):
2.224 + "Return a new boolean for the comparison."
2.225 + return not self.__lt__(other)
2.226 +
2.227 + def __eq__(self, other):
2.228 + "Return a new boolean for the comparison."
2.229 + return _binary_op(self, other, native._int_eq)
2.230 +
2.231 + def __ne__(self, other):
2.232 + "Return a new boolean for the comparison."
2.233 + return not self.__eq__(other)
2.234 +
2.235 def __neg__(self): pass
2.236 def __pos__(self): pass
2.237 def __str__(self): pass
2.238 - def __bool__(self): pass
2.239 def __lshift__(self): pass
2.240 def __rlshift__(self): pass
2.241 def __rshift__(self): pass
2.242 def __rrshift__(self): pass
2.243
2.244 + def __bool__(self):
2.245 + "Return whether this int is non-zero."
2.246 + return not native._int_eq(self, 0)
2.247 +
2.248 class list(object):
2.249
2.250 "Implementation of list."
2.251 @@ -557,6 +664,15 @@
2.252
2.253 # Utility functions.
2.254
2.255 +def _binary_op(self, other, op):
2.256 +
2.257 + "Test the type of 'other' and perform 'op'."
2.258 +
2.259 + if self.__class__ is other.__class__:
2.260 + return op(self, other)
2.261 + else:
2.262 + return NotImplemented
2.263 +
2.264 def _get_absolute_index(index, length):
2.265
2.266 """
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/lib/native.py Mon Jun 13 20:59:00 2011 +0200
3.3 @@ -0,0 +1,46 @@
3.4 +#!/usr/bin/env python
3.5 +
3.6 +"""
3.7 +Native library functions.
3.8 +
3.9 +Copyright (C) 2011 Paul Boddie <paul@boddie.org.uk>
3.10 +
3.11 +This program is free software; you can redistribute it and/or modify it under
3.12 +the terms of the GNU General Public License as published by the Free Software
3.13 +Foundation; either version 3 of the License, or (at your option) any later
3.14 +version.
3.15 +
3.16 +This program is distributed in the hope that it will be useful, but WITHOUT
3.17 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
3.18 +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
3.19 +details.
3.20 +
3.21 +You should have received a copy of the GNU General Public License along with
3.22 +this program. If not, see <http://www.gnu.org/licenses/>.
3.23 +"""
3.24 +
3.25 +def _int_add(self, other): pass
3.26 +def _int_sub(self, other): pass
3.27 +def _int_mul(self, other): pass
3.28 +def _int_div(self, other): pass
3.29 +def _int_mod(self, other): pass
3.30 +def _int_pow(self, other): pass
3.31 +def _int_and(self, other): pass
3.32 +def _int_or(self, other): pass
3.33 +def _int_xor(self, other): pass
3.34 +
3.35 +def _int_rsub(self, other): pass
3.36 +def _int_rdiv(self, other): pass
3.37 +def _int_rmod(self, other): pass
3.38 +def _int_rpow(self, other): pass
3.39 +
3.40 +def _int_lt(self, other): pass
3.41 +def _int_gt(self, other): pass
3.42 +def _int_eq(self, other): pass
3.43 +
3.44 +def _str_add(self, other): pass
3.45 +def _str_lt(self, other): pass
3.46 +def _str_gt(self, other): pass
3.47 +def _str_eq(self, other): pass
3.48 +
3.49 +# vim: tabstop=4 expandtab shiftwidth=4
4.1 --- a/micropython/__init__.py Mon Jun 13 00:18:13 2011 +0200
4.2 +++ b/micropython/__init__.py Mon Jun 13 20:59:00 2011 +0200
4.3 @@ -125,7 +125,7 @@
4.4 last_module = self.importer.modules_ordered[-1]
4.5
4.6 for module in self.importer.modules_ordered:
4.7 - suppress_builtins = not with_builtins and module.name == "__builtins__"
4.8 + suppress_builtins = not with_builtins and module.name in ("__builtins__", "native")
4.9
4.10 # Position the module in the image and make a translation.
4.11
4.12 @@ -249,7 +249,7 @@
4.13
4.14 for module in self.importer.modules_ordered:
4.15
4.16 - if not with_builtins and module.name == "__builtins__":
4.17 + if not with_builtins and module.name in ("__builtins__", "native"):
4.18 continue
4.19
4.20 module.code_location = module.blocks[0].location
5.1 --- a/micropython/inspect.py Mon Jun 13 00:18:13 2011 +0200
5.2 +++ b/micropython/inspect.py Mon Jun 13 20:59:00 2011 +0200
5.3 @@ -654,8 +654,11 @@
5.4 self.define_attribute_user(node)
5.5
5.6 # Ensure the presence of the given name in this namespace.
5.7 + # NOTE: Consider not registering assignments involving methods, since
5.8 + # NOTE: this is merely creating aliases for such methods.
5.9
5.10 self.use_specific_attribute(None, node.name)
5.11 +
5.12 return None
5.13
5.14 visitAssTuple = visitAssList
6.1 --- a/micropython/raw.py Mon Jun 13 00:18:13 2011 +0200
6.2 +++ b/micropython/raw.py Mon Jun 13 20:59:00 2011 +0200
6.3 @@ -34,7 +34,7 @@
6.4 pass
6.5
6.6 def is_generated(self, with_builtins):
6.7 - return with_builtins or self.item.module.name != "__builtins__" or self.item.astnode.doc is not None
6.8 + return with_builtins or self.item.module.name not in ("__builtins__", "native") or self.item.astnode.doc is not None
6.9
6.10 class UntranslatableInstruction(Exception):
6.11 pass
7.1 --- a/rsvplib.py Mon Jun 13 00:18:13 2011 +0200
7.2 +++ b/rsvplib.py Mon Jun 13 20:59:00 2011 +0200
7.3 @@ -69,25 +69,16 @@
7.4 def _check_index(self, pos, nelements):
7.5 return pos >= 0 and pos < nelements
7.6
7.7 - def builtins_int_arithmetic_op(self, op):
7.8 - frame = self.local_sp_stack[-1]
7.9 + # Native functionality.
7.10
7.11 - # Get operands addresses.
7.12 -
7.13 - left_value = self.frame_stack[frame]
7.14 - right_value = self.frame_stack[frame + 1]
7.15 + def builtins_no_op(self):
7.16 + pass
7.17
7.18 - # Test operand suitability.
7.19 - # NOTE: Support other types.
7.20 -
7.21 - if not (self.machine._CheckInstance(left_value.ref, self.int_class) and
7.22 - self.machine._CheckInstance(right_value.ref, self.int_class)):
7.23 -
7.24 - self.machine.exception = self.machine._MakeObject(self.instance_size, self.type_error_instance)
7.25 - return self.machine.RaiseException()
7.26 -
7.27 - left_data = left_value.ref + self.instance_data_offset
7.28 - right_data = right_value.ref + self.instance_data_offset
7.29 + def native_int_arithmetic_op(self, op):
7.30 + self.machine.LoadName(0) # left value
7.31 + left_data = self.machine.value + self.instance_data_offset
7.32 + self.machine.LoadName(1) # right value
7.33 + right_data = self.machine.value + self.instance_data_offset
7.34
7.35 # Make a new object.
7.36
7.37 @@ -104,28 +95,11 @@
7.38 self.machine.result_context = addr
7.39 self.machine.result_value = addr
7.40
7.41 - def builtins_logical_op(self, operand_class, op):
7.42 - frame = self.local_sp_stack[-1]
7.43 -
7.44 - # Get operands addresses.
7.45 -
7.46 - left_value = self.frame_stack[frame]
7.47 - right_value = self.frame_stack[frame + 1]
7.48 -
7.49 - # Test operand suitability.
7.50 - # NOTE: Handle comparisons of incompatible types more appropriately.
7.51 - # NOTE: Return NotImplemented.
7.52 -
7.53 - if not (self.machine._CheckInstance(left_value.ref, operand_class) and
7.54 - self.machine._CheckInstance(right_value.ref, operand_class)):
7.55 -
7.56 - notimpl = self.constants[NotImplemented]
7.57 - self.machine.result_context = notimpl
7.58 - self.machine.result_value = notimpl
7.59 - return
7.60 -
7.61 - left_data = left_value.ref + self.instance_data_offset
7.62 - right_data = right_value.ref + self.instance_data_offset
7.63 + def native_logical_op(self, op):
7.64 + self.machine.LoadName(0) # left value
7.65 + left_data = self.machine.value + self.instance_data_offset
7.66 + self.machine.LoadName(1) # right value
7.67 + right_data = self.machine.value + self.instance_data_offset
7.68
7.69 # Test the data.
7.70 # NOTE: The data is considered ready to use.
7.71 @@ -142,98 +116,44 @@
7.72 # still performed on the operands to ensure that they qualify for these
7.73 # native operations.
7.74
7.75 - def builtins_int_add(self):
7.76 - return self.builtins_int_arithmetic_op(operator.add)
7.77 -
7.78 - def builtins_int_sub(self):
7.79 - return self.builtins_int_arithmetic_op(operator.sub)
7.80 + def native_int_add(self):
7.81 + return self.native_int_arithmetic_op(operator.add)
7.82
7.83 - def builtins_int_pow(self):
7.84 - return self.builtins_int_arithmetic_op(operator.pow)
7.85 -
7.86 - def builtins_int_lt(self):
7.87 - return self.builtins_logical_op(self.int_class, operator.lt)
7.88 + def native_int_sub(self):
7.89 + return self.native_int_arithmetic_op(operator.sub)
7.90
7.91 - def builtins_int_le(self):
7.92 - return self.builtins_logical_op(self.int_class, operator.le)
7.93 -
7.94 - def builtins_int_gt(self):
7.95 - return self.builtins_logical_op(self.int_class, operator.gt)
7.96 + def native_int_pow(self):
7.97 + return self.native_int_arithmetic_op(operator.pow)
7.98
7.99 - def builtins_int_ge(self):
7.100 - return self.builtins_logical_op(self.int_class, operator.ge)
7.101 + def native_int_and(self):
7.102 + return self.native_int_arithmetic_op(operator.and_)
7.103
7.104 - def builtins_int_eq(self):
7.105 - return self.builtins_logical_op(self.int_class, operator.eq)
7.106 + def native_int_or(self):
7.107 + return self.native_int_arithmetic_op(operator.or_)
7.108
7.109 - def builtins_int_ne(self):
7.110 - return self.builtins_logical_op(self.int_class, operator.ne)
7.111 -
7.112 - def builtins_str_lt(self):
7.113 - return self.builtins_logical_op(self.str_class, operator.lt)
7.114 + def native_int_lt(self):
7.115 + return self.native_logical_op(operator.lt)
7.116
7.117 - def builtins_str_le(self):
7.118 - return self.builtins_logical_op(self.str_class, operator.le)
7.119 + def native_int_gt(self):
7.120 + return self.native_logical_op(operator.gt)
7.121
7.122 - def builtins_str_gt(self):
7.123 - return self.builtins_logical_op(self.str_class, operator.gt)
7.124 + def native_int_eq(self):
7.125 + return self.native_logical_op(operator.eq)
7.126
7.127 - def builtins_str_ge(self):
7.128 - return self.builtins_logical_op(self.str_class, operator.ge)
7.129 -
7.130 - def builtins_str_eq(self):
7.131 - return self.builtins_logical_op(self.str_class, operator.eq)
7.132 + def native_str_lt(self):
7.133 + return self.native_logical_op(operator.lt)
7.134
7.135 - def builtins_str_ne(self):
7.136 - return self.builtins_logical_op(self.str_class, operator.ne)
7.137 + def native_str_gt(self):
7.138 + return self.native_logical_op(operator.gt)
7.139
7.140 - def builtins_int_and(self):
7.141 - return self.builtins_int_arithmetic_op(operator.and_)
7.142 -
7.143 - def builtins_int_or(self):
7.144 - return self.builtins_int_arithmetic_op(operator.or_)
7.145 + def native_str_eq(self):
7.146 + return self.native_logical_op(operator.eq)
7.147
7.148 # Specific operator methods.
7.149
7.150 - def builtins_int_bool(self):
7.151 - frame = self.local_sp_stack[-1]
7.152 -
7.153 - # Get operands addresses.
7.154 -
7.155 - left_value = self.frame_stack[frame]
7.156 -
7.157 - # Test operand suitability.
7.158 -
7.159 - if not self.machine._CheckInstance(left_value.ref, self.int_class):
7.160 - self.machine.exception = self.machine._MakeObject(self.instance_size, self.type_error_instance)
7.161 - return self.machine.RaiseException()
7.162 -
7.163 - left_data = left_value.ref + self.instance_data_offset
7.164 -
7.165 - # Test the data.
7.166 - # NOTE: The data is considered ready to use.
7.167 -
7.168 - if self.machine.load(left_data) != 0:
7.169 - self.machine.result_context = self.constants[True]
7.170 - self.machine.result_value = self.constants[True]
7.171 - else:
7.172 - self.machine.result_context = self.constants[False]
7.173 - self.machine.result_value = self.constants[False]
7.174 -
7.175 def builtins_int_neg(self):
7.176 - frame = self.local_sp_stack[-1]
7.177 -
7.178 - # Get operands addresses.
7.179 -
7.180 - left_value = self.frame_stack[frame]
7.181 -
7.182 - # Test operand suitability.
7.183 -
7.184 - if not self.machine._CheckInstance(left_value.ref, self.int_class):
7.185 - self.machine.exception = self.machine._MakeObject(self.instance_size, self.type_error_instance)
7.186 - return self.machine.RaiseException()
7.187 -
7.188 - left_data = left_value.ref + self.instance_data_offset
7.189 + self.machine.LoadName(0) # left value
7.190 + left_data = self.machine.value + self.instance_data_offset
7.191
7.192 # Make a new object.
7.193
7.194 @@ -252,15 +172,6 @@
7.195
7.196 # Various built-in methods.
7.197
7.198 - def builtins_bool_bool(self):
7.199 - frame = self.local_sp_stack[-1]
7.200 -
7.201 - # Get operands addresses.
7.202 -
7.203 - left_value = self.frame_stack[frame]
7.204 - self.machine.result_context = left_value.ref
7.205 - self.machine.result_value = left_value.ref
7.206 -
7.207 def builtins_list_new(self):
7.208 frame = self.local_sp_stack[-1]
7.209
7.210 @@ -502,9 +413,6 @@
7.211 self.machine.result_context = data.context
7.212 self.machine.result_value = data.ref
7.213
7.214 - def builtins_object_init(self):
7.215 - pass
7.216 -
7.217 def builtins_getattr(self):
7.218 frame = self.local_sp_stack[-1]
7.219
7.220 @@ -569,30 +477,18 @@
7.221
7.222 # Native method implementations:
7.223
7.224 - "__builtins__.basestring.__lt__" : builtins_str_lt,
7.225 - "__builtins__.basestring.__le__" : builtins_str_le,
7.226 - "__builtins__.basestring.__gt__" : builtins_str_gt,
7.227 - "__builtins__.basestring.__ge__" : builtins_str_ge,
7.228 - "__builtins__.basestring.__eq__" : builtins_str_eq,
7.229 - "__builtins__.basestring.__ne__" : builtins_str_ne,
7.230 - "__builtins__.bool.__bool__" : builtins_bool_bool,
7.231 - "__builtins__.int.__add__" : builtins_int_add,
7.232 - "__builtins__.int.__radd__" : builtins_int_add, # NOTE: To be made distinct.
7.233 - "__builtins__.int.__sub__" : builtins_int_sub,
7.234 - "__builtins__.int.__pow__" : builtins_int_pow,
7.235 - "__builtins__.int.__iadd__" : builtins_int_add,
7.236 - "__builtins__.int.__bool__" : builtins_int_bool,
7.237 + "native._int_add" : native_int_add,
7.238 + "native._int_sub" : native_int_sub,
7.239 + "native._int_pow" : native_int_pow,
7.240 + "native._int_and" : native_int_and,
7.241 + "native._int_or" : native_int_or,
7.242 + "native._int_lt" : native_int_lt,
7.243 + "native._int_gt" : native_int_gt,
7.244 + "native._int_eq" : native_int_eq,
7.245 + "native._str_lt" : native_str_lt,
7.246 + "native._str_gt" : native_str_gt,
7.247 + "native._str_eq" : native_str_eq,
7.248 "__builtins__.int.__neg__" : builtins_int_neg,
7.249 - "__builtins__.int.__lt__" : builtins_int_lt,
7.250 - "__builtins__.int.__le__" : builtins_int_le,
7.251 - "__builtins__.int.__gt__" : builtins_int_gt,
7.252 - "__builtins__.int.__ge__" : builtins_int_ge,
7.253 - "__builtins__.int.__eq__" : builtins_int_eq,
7.254 - "__builtins__.int.__ne__" : builtins_int_ne,
7.255 - "__builtins__.int.__and__" : builtins_int_and,
7.256 - "__builtins__.int.__rand__" : builtins_int_and,
7.257 - "__builtins__.int.__or__" : builtins_int_or,
7.258 - "__builtins__.int.__ror__" : builtins_int_or,
7.259 "__builtins__.list.__get_single_item__" : builtins_list_get_single_item,
7.260 "__builtins__.list.__len__" : builtins_list_len,
7.261 "__builtins__.list.append" : builtins_list_append,
7.262 @@ -602,8 +498,7 @@
7.263
7.264 # Native initialisers:
7.265
7.266 - "__builtins__.object.__init__" : builtins_object_init, # NOTE: A no-operation.
7.267 - "__builtins__.BaseException.__init__" : builtins_object_init, # NOTE: To be made distinct, potentially in the builtins module.
7.268 + "__builtins__.BaseException.__init__" : builtins_no_op, # NOTE: To be made distinct, potentially in the builtins module.
7.269
7.270 # Native functions:
7.271