summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-03-16 13:32:03 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-03-16 13:36:58 +0200
commit2b67a40fdb9918a82c4da67a3f7ae4b3a5e29ce7 (patch)
treee6430e5822917ac759f5a94d8daa19be0bb1dfad /py
parent66c11ec581ddba872ca59492bf8dd7fd4512b5ad (diff)
downloadmicropython-2b67a40fdb9918a82c4da67a3f7ae4b3a5e29ce7.tar.gz
micropython-2b67a40fdb9918a82c4da67a3f7ae4b3a5e29ce7.zip
objtype: Clarify comment for mp_obj_class_lookup().
Diffstat (limited to 'py')
-rw-r--r--py/objtype.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/py/objtype.c b/py/objtype.c
index 46482995d9..6421f7f099 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -90,13 +90,15 @@ STATIC int instance_count_native_bases(const mp_obj_type_t *type, const mp_obj_t
// http://python-history.blogspot.com/2010/06/method-resolution-order.html
// https://www.python.org/download/releases/2.3/mro/
//
-// will return MP_OBJ_NULL if not found
-// will return MP_OBJ_SENTINEL if special method was found in a native type base
-// via slot id (meth_offset). As there can be only one native base, it's known that it
-// applies to instance->subobj[0]. In most cases, we also don't need to know which type
-// it was - because instance->subobj[0] is of that type. The only exception is when
-// object is not yet constructed, then we need to know base native type to construct
-// instance->subobj[0]. This case is handled via instance_count_native_bases() though.
+// will keep lookup->dest[0]'s value (should be MP_OBJ_NULL on invocation) if attribute
+// is not found
+// will set lookup->dest[0] to MP_OBJ_SENTINEL if special method was found in a native
+// type base via slot id (as specified by lookup->meth_offset). As there can be only one
+// native base, it's known that it applies to instance->subobj[0]. In most cases, we also
+// don't need to know which type it was - because instance->subobj[0] is of that type.
+// The only exception is when object is not yet constructed, then we need to know base
+// native type to construct its instance->subobj[0] from. But this case is handled via
+// instance_count_native_bases(), which returns a native base which it saw.
struct class_lookup_data {
mp_obj_instance_t *obj;
qstr attr;