diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-05 17:46:47 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-05 17:46:47 +0300 |
commit | e99841be690fbc89763d05fdcfe5870d438a2dad (patch) | |
tree | 951728658f85541e1a09fe01a944f770b3f4ab8f /py/obj.c | |
parent | 09a4d8305d09c82464f354b50fe878da7661c2b5 (diff) | |
download | micropython-e99841be690fbc89763d05fdcfe5870d438a2dad.tar.gz micropython-e99841be690fbc89763d05fdcfe5870d438a2dad.zip |
mp_obj_get_int(): Add warning against adding implicit float->int conversion.
Diffstat (limited to 'py/obj.c')
-rw-r--r-- | py/obj.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) { |