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

Method print_call_line

Lib/pstats.py:480–503  ·  view source on GitHub ↗
(self, name_size, source, call_dict, arrow="->")

Source from the content-addressed store, hash-verified

478 print(" "*name_size + " ncalls tottime cumtime", file=self.stream)
479
480 def print_call_line(self, name_size, source, call_dict, arrow="->"):
481 print(func_std_string(source).ljust(name_size) + arrow, end=' ', file=self.stream)
482 if not call_dict:
483 print(file=self.stream)
484 return
485 clist = sorted(call_dict.keys())
486 indent = ""
487 for func in clist:
488 name = func_std_string(func)
489 value = call_dict[func]
490 if isinstance(value, tuple):
491 nc, cc, tt, ct = value
492 if nc != cc:
493 substats = '%d/%d' % (nc, cc)
494 else:
495 substats = '%d' % (nc,)
496 substats = '%s %s %s %s' % (substats.rjust(7+2*len(indent)),
497 f8(tt), f8(ct), name)
498 left_width = name_size + 1
499 else:
500 substats = '%s(%r) %s' % (name, value, f8(self.stats[func][3]))
501 left_width = name_size + 3
502 print(indent*left_width + substats, file=self.stream)
503 indent = " "
504
505 def print_title(self):
506 print(' ncalls tottime percall cumtime percall', end=' ', file=self.stream)

Callers 2

print_calleesMethod · 0.95
print_callersMethod · 0.95

Calls 5

func_std_stringFunction · 0.85
f8Function · 0.85
ljustMethod · 0.45
keysMethod · 0.45
rjustMethod · 0.45

Tested by

no test coverage detected