Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
34254313
Commit
34254313
authored
Mar 20, 2015
by
Paul Sokolovsky
Browse files
objtype: More comment clarification for attribute lookup.
parent
f8ee88bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objtype.c
View file @
34254313
...
...
@@ -131,8 +131,8 @@ STATIC void mp_obj_class_lookup(struct class_lookup_data *lookup, const mp_obj_
if
(
elem
!=
NULL
)
{
lookup
->
dest
[
0
]
=
elem
->
value
;
if
(
lookup
->
is_type
)
{
// If we look up class method, we need to
pass
original type
there,
//
not type where
we found
a
class method.
// If we look up
a
class method, we need to
return
original type
for which we
//
do a lookup, not a (base) type in which
we found
the
class method.
const
mp_obj_type_t
*
org_type
=
(
const
mp_obj_type_t
*
)
lookup
->
obj
;
instance_convert_return_attr
(
NULL
,
org_type
,
elem
->
value
,
lookup
->
dest
);
}
else
{
...
...
@@ -425,7 +425,7 @@ STATIC void instance_convert_return_attr(mp_obj_t self, const mp_obj_type_t *typ
dest
[
0
]
=
((
mp_obj_static_class_method_t
*
)
member
)
->
fun
;
dest
[
1
]
=
(
mp_obj_t
)
type
;
}
else
if
(
MP_OBJ_IS_TYPE
(
member
,
&
mp_type_type
))
{
// Don't try to bind types
// Don't try to bind types
(even though they're callable)
dest
[
0
]
=
member
;
}
else
if
(
mp_obj_is_callable
(
member
))
{
// return a bound method, with self being this object
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment