py: Allow retrieving a function's __name__.

Disabled by default.  Enabled on unix and stmhal ports.
This commit is contained in:
stijn
2015-02-14 18:44:31 +01:00
committed by Damien George
parent 07b8dc68d6
commit 3cc17c69ff
9 changed files with 54 additions and 8 deletions

View File

@@ -97,7 +97,7 @@ mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun) {
STATIC void gen_instance_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
(void)kind;
mp_obj_gen_instance_t *self = self_in;
print(env, "<generator object '%s' at %p>", mp_obj_code_get_name(self->code_state.code_info), self_in);
print(env, "<generator object '%s' at %p>", qstr_str(mp_obj_code_get_name(self->code_state.code_info)), self_in);
}
mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val) {