diff options
| author | Paul Sokolovsky | 2014-01-13 19:19:16 +0200 |
|---|---|---|
| committer | Paul Sokolovsky | 2014-01-15 02:15:38 +0200 |
| commit | 76d982ef343dcadd35355aed9c568984c850fb7b (patch) | |
| tree | 1ded5f199ce740d3b72c00cc1e9c2b402936632f /py/objtype.c | |
| parent | 24224d7c72e1d6572ef0d24f08eb882dcac8dc50 (diff) | |
type->print(): Distinguish str() and repr() variety by passing extra param.
Diffstat (limited to 'py/objtype.c')
| -rw-r--r-- | py/objtype.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objtype.c b/py/objtype.c index 011ee4355..5a2f96d6b 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -66,7 +66,7 @@ static mp_map_elem_t *mp_obj_class_lookup(const mp_obj_type_t *type, qstr attr, } } -static void class_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in) { +static void class_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { print(env, "<%s object at %p>", mp_obj_get_type_str(self_in), self_in); } @@ -148,7 +148,7 @@ static bool class_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t value) { // - there is a constant mp_obj_type_t (called mp_const_type) for the 'type' object // - creating a new class (a new type) creates a new mp_obj_type_t -static void type_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in) { +static void type_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { mp_obj_type_t *self = self_in; print(env, "<class '%s'>", self->name); } |
