Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e99841be
Commit
e99841be
authored
Apr 05, 2014
by
Paul Sokolovsky
Browse files
mp_obj_get_int(): Add warning against adding implicit float->int conversion.
parent
09a4d830
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/obj.c
View file @
e99841be
...
...
@@ -181,6 +181,9 @@ bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2) {
}
machine_int_t
mp_obj_get_int
(
mp_obj_t
arg
)
{
// This function essentially performs implicit type conversion to int
// Note that Python does NOT provide implicit type conversion from
// float to int in the core expression language, try some_list[1.0].
if
(
arg
==
mp_const_false
)
{
return
0
;
}
else
if
(
arg
==
mp_const_true
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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