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

@@ -574,8 +574,8 @@ typedef struct _mp_obj_fun_builtin_t { // use this to make const objects that go
void *fun; // must be a pointer to a callable function in ROM
} mp_obj_fun_builtin_t;
const char *mp_obj_fun_get_name(mp_const_obj_t fun);
const char *mp_obj_code_get_name(const byte *code_info);
qstr mp_obj_fun_get_name(mp_const_obj_t fun);
qstr mp_obj_code_get_name(const byte *code_info);
mp_obj_t mp_identity(mp_obj_t self);
MP_DECLARE_CONST_FUN_OBJ(mp_identity_obj);