py: Simpler implementation of mp_obj_callable.

This commit is contained in:
Damien George 2014-01-23 18:13:53 +00:00
parent cfedd81c07
commit b051e7d167
1 changed files with 1 additions and 6 deletions

View File

@ -66,12 +66,7 @@ void mp_obj_print_exception(mp_obj_t exc) {
} }
bool mp_obj_is_callable(mp_obj_t o_in) { bool mp_obj_is_callable(mp_obj_t o_in) {
if (!MP_OBJ_IS_OBJ(o_in)) { return mp_obj_get_type(o_in)->call != NULL;
return false;
} else {
mp_obj_base_t *o = o_in;
return o->type->call != NULL;
}
} }
machine_int_t mp_obj_hash(mp_obj_t o_in) { machine_int_t mp_obj_hash(mp_obj_t o_in) {