MCPcopy Index your code
hub / github.com/python/cpython / do_sort

Method do_sort

Lib/pstats.py:786–797  ·  view source on GitHub ↗
(self, line)

Source from the content-addressed store, hash-verified

784 print("Reverse the sort order of the profiling report.", file=self.stream)
785
786 def do_sort(self, line):
787 if not self.stats:
788 print("No statistics object is loaded.", file=self.stream)
789 return
790 abbrevs = self.stats.get_sort_arg_defs()
791 if line and all((x in abbrevs) for x in line.split()):
792 self.stats.sort_stats(*line.split())
793 else:
794 print("Valid sort keys (unique prefixes are accepted):", file=self.stream)
795 for (key, value) in Stats.sort_arg_dict_default.items():
796 print("%s -- %s" % (key, value[1]), file=self.stream)
797 return 0
798 def help_sort(self):
799 print("Sort profile data according to specified keys.", file=self.stream)
800 print("(Typing `sort' without arguments lists valid keys.)", file=self.stream)

Callers

nothing calls this directly

Calls 4

get_sort_arg_defsMethod · 0.80
sort_statsMethod · 0.80
splitMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected