Merge branch 'master' of github.com:micropython/micropython

This commit is contained in:
Damien George 2014-04-05 17:19:03 +01:00
commit 6d508666ea
1 changed files with 3 additions and 0 deletions

View File

@ -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) { 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) { if (arg == mp_const_false) {
return 0; return 0;
} else if (arg == mp_const_true) { } else if (arg == mp_const_true) {