diff --git a/IPython/lib/pretty.py b/IPython/lib/pretty.py index 546446e..3486450 100644 --- a/IPython/lib/pretty.py +++ b/IPython/lib/pretty.py @@ -918,7 +918,7 @@ def _counter_pprint(obj, p, cycle): if cycle: p.pretty(cls_ctor(RawText("..."))) elif len(obj): - p.pretty(cls_ctor(dict(sorted(obj.items(), key=lambda x: x[1], reverse=True)))) + p.pretty(cls_ctor(dict(obj.most_common()))) else: p.pretty(cls_ctor())