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
8dd5960a
Commit
8dd5960a
authored
Sep 19, 2016
by
Damien George
Browse files
py/objnone: Use mp_generic_unary_op instead of custom one.
parent
5da0d29d
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objnone.c
View file @
8dd5960a
...
...
@@ -43,20 +43,11 @@ STATIC void none_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_
}
}
STATIC
mp_obj_t
none_unary_op
(
mp_uint_t
op
,
mp_obj_t
o_in
)
{
(
void
)
o_in
;
switch
(
op
)
{
// MP_UNARY_OP_BOOL is handled by a fast-path in mp_obj_is_true
case
MP_UNARY_OP_HASH
:
return
MP_OBJ_NEW_SMALL_INT
((
mp_uint_t
)
o_in
);
default:
return
MP_OBJ_NULL
;
// op not supported
}
}
const
mp_obj_type_t
mp_type_NoneType
=
{
{
&
mp_type_type
},
.
name
=
MP_QSTR_NoneType
,
.
print
=
none_print
,
.
unary_op
=
none
_unary_op
,
.
unary_op
=
mp_generic
_unary_op
,
};
const
mp_obj_none_t
mp_const_none_obj
=
{{
&
mp_type_NoneType
}};
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