Skip to content

Commit 2758b7d

Browse files
committed
objcell: Add disabled by default print method for debugging.
1 parent c86889d commit 2758b7d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

py/objcell.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,24 @@ void mp_obj_cell_set(mp_obj_t self_in, mp_obj_t obj) {
2020
self->obj = obj;
2121
}
2222

23+
#if 0
24+
STATIC void cell_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) {
25+
mp_obj_cell_t *o = o_in;
26+
print(env, "<cell ");
27+
if (o->obj == MP_OBJ_NULL) {
28+
print(env, "(nil)");
29+
} else {
30+
//print(env, "%p", o->obj);
31+
mp_obj_print_helper(print, env, o->obj, PRINT_REPR);
32+
}
33+
print(env, ">");
34+
}
35+
#endif
36+
2337
const mp_obj_type_t cell_type = {
2438
{ &mp_type_type },
2539
.name = MP_QSTR_, // should never need to print cell type
40+
//.print = cell_print,
2641
};
2742

2843
mp_obj_t mp_obj_new_cell(mp_obj_t obj) {

0 commit comments

Comments
 (0)