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
3cb76634
Commit
3cb76634
authored
Mar 16, 2015
by
Paul Sokolovsky
Browse files
objtype: Refactor dealing with native sub-objects for clarity.
parent
f0dc0d50
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objtype.c
View file @
3cb76634
...
...
@@ -135,10 +135,13 @@ STATIC void mp_obj_class_lookup(struct class_lookup_data *lookup, const mp_obj_
// not type where we found a 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
if
(
lookup
->
obj
!=
MP_OBJ_NULL
&&
is_native_type
(
type
)
&&
type
!=
&
mp_type_object
/* object is not a real type */
)
{
instance_convert_return_attr
(
lookup
->
obj
->
subobj
[
0
],
type
,
elem
->
value
,
lookup
->
dest
);
}
else
{
instance_convert_return_attr
(
lookup
->
obj
,
type
,
elem
->
value
,
lookup
->
dest
);
mp_obj_instance_t
*
obj
=
lookup
->
obj
;
if
(
obj
!=
MP_OBJ_NULL
&&
is_native_type
(
type
)
&&
type
!=
&
mp_type_object
/* object is not a real type */
)
{
// If we're dealing with native base class, then it applies to native sub-object
obj
=
obj
->
subobj
[
0
];
}
instance_convert_return_attr
(
obj
,
type
,
elem
->
value
,
lookup
->
dest
);
}
#if DEBUG_PRINT
printf
(
"mp_obj_class_lookup: Returning: "
);
...
...
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