MCPcopy Index your code
hub / github.com/ipython/ipython / _sorted_for_pprint

Function _sorted_for_pprint

IPython/lib/pretty.py:138–151  ·  view source on GitHub ↗

Sort the given items for pretty printing. Since some predictable sorting is better than no sorting at all, we sort on the string representation if normal sorting fails.

(items)

Source from the content-addressed store, hash-verified

136 return default
137
138def _sorted_for_pprint(items):
139 """
140 Sort the given items for pretty printing. Since some predictable
141 sorting is better than no sorting at all, we sort on the string
142 representation if normal sorting fails.
143 """
144 items = list(items)
145 try:
146 return sorted(items)
147 except Exception:
148 try:
149 return sorted(items, key=str)
150 except Exception:
151 return items
152
153def pretty(obj, verbose=False, max_width=79, newline='\n', max_seq_length=MAX_SEQ_LENGTH):
154 """

Callers 1

innerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…