summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-02-01 23:32:29 +0000
committerDamien George <damien.p.george@gmail.com>2014-02-01 23:32:29 +0000
commit48697f1dd2fbf45fda6de4277de976c23e7d8302 (patch)
treeac644b1e54f9dcdbf250ce8b57771c8e2d82cc97
parent9aa2a527b532e31c77592cede3b38c018c83ac64 (diff)
downloadmicropython-48697f1dd2fbf45fda6de4277de976c23e7d8302.tar.gz
micropython-48697f1dd2fbf45fda6de4277de976c23e7d8302.zip
Tidy up some comments.
-rw-r--r--py/runtime.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/py/runtime.c b/py/runtime.c
index d22fba8f00..6f6e3c903e 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -519,8 +519,6 @@ mp_obj_t rt_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
// deal with is
if (op == RT_BINARY_OP_IS) {
- // TODO: may need to handle strings specially, CPython appears to
- // assume all strings are interned (so "is" == "==" for strings)
return MP_BOOL(lhs == rhs);
}
@@ -624,13 +622,13 @@ mp_obj_t rt_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
/* deal with `in`
*
* NOTE `a in b` is `b.__contains__(a)`, hence why the generic dispatch
- * needs to go below
+ * needs to go below with swapped arguments
*/
if (op == RT_BINARY_OP_IN) {
mp_obj_type_t *type = mp_obj_get_type(rhs);
if (type->binary_op != NULL) {
mp_obj_t res = type->binary_op(op, rhs, lhs);
- if (res != NULL) {
+ if (res != MP_OBJ_NULL) {
return res;
}
}