diff --git a/easypy/humanize.py b/easypy/humanize.py index c7ea279..d7f6be3 100644 --- a/easypy/humanize.py +++ b/easypy/humanize.py @@ -614,7 +614,13 @@ def ipython_fields_repr(name, field_items, p, cycle): def ipython_mapping_repr(mapping, p, cycle): """Used by IPython. add to any mapping class as '_repr_pretty_'""" - ipython_fields_repr(mapping.__class__.__name__, sorted(mapping.items()), p, cycle) + try: + mapping_items = sorted(mapping.items()) + except TypeError: + # some objcets do not support sorting + mapping_items = list(mapping.items()) + + ipython_fields_repr(mapping.__class__.__name__, mapping_items, p, cycle) BAR_SEQUENCE = ' ▏▎▍▌▋▊▉██'