summaryrefslogtreecommitdiff
path: root/py/runtime.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-27 18:02:25 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-27 18:02:25 +0000
commita5efcd474563ed4e3d979a619f073abab8379a09 (patch)
tree89ec313adc7023552dbb09ad92e0ba9ff00082ef /py/runtime.h
parenta9dc9b8f6dc29d842f0a7427cc3cf068ae1cfbea (diff)
py: Specify unary/binary op name in TypeError error message.
Eg, "() + 1" now tells you that __add__ is not supported for tuple and int types (before it just said the generic "binary operator"). We reuse the table of names for slot lookup because it would be a waste of code space to store the pretty name for each operator.
Diffstat (limited to 'py/runtime.h')
-rw-r--r--py/runtime.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/runtime.h b/py/runtime.h
index 1216462b2..a4386b4bb 100644
--- a/py/runtime.h
+++ b/py/runtime.h
@@ -56,6 +56,10 @@ typedef struct _mp_arg_t {
mp_arg_val_t defval;
} mp_arg_t;
+// defined in objtype.c
+extern const qstr mp_unary_op_method_name[];
+extern const qstr mp_binary_op_method_name[];
+
void mp_init(void);
void mp_deinit(void);