On this page
pstats.SortKey
Prev: pstats.FunctionProfile | Up: pstats | Next: pstats.Stats
Rel: pstats.FunctionProfile, pstats.Stats, pstats.StatsProfile
Ref: docs.python.org — pstats.SortKey
Tags: #public #python3 #stdlib #pstats
Import
import pstats
from pstats import SortKey
Signature & Overview
pstats.SortKey(*values)
An enumeration.
Methods & Attributes
SortKey.capitalize(self, /)— Return a capitalized version of the string.SortKey.casefold(self, /)— Return a version of the string suitable for caseless comparisons.SortKey.center(self, width, fillchar=' ', /)— Return a centered string of length width.SortKey.count(...)— Return the number of non-overlapping occurrences of substring sub in string S[start:end].SortKey.encode(self, /, encoding='utf-8', errors='strict')— Encode the string using the codec registered for encoding.SortKey.endswith(...)— Return True if the string ends with the specified suffix, False otherwise.SortKey.expandtabs(self, /, tabsize=8)— Return a copy where all tab characters are expanded using spaces.SortKey.find(...)— Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].SortKey.format(self, /, *args, **kwargs)— Return a formatted version of the string, using substitutions from args and kwargs.SortKey.format_map(self, mapping, /)— Return a formatted version of the string, using substitutions from mapping.SortKey.index(...)— Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].SortKey.isalnum(self, /)— Return True if the string is an alpha-numeric string, False otherwise.SortKey.isalpha(self, /)— Return True if the string is an alphabetic string, False otherwise.SortKey.isascii(self, /)— Return True if all characters in the string are ASCII, False otherwise.SortKey.isdecimal(self, /)— Return True if the string is a decimal string, False otherwise.SortKey.isdigit(self, /)— Return True if the string is a digit string, False otherwise.SortKey.isidentifier(self, /)— Return True if the string is a valid Python identifier, False otherwise.SortKey.islower(self, /)— Return True if the string is a lowercase string, False otherwise.SortKey.isnumeric(self, /)— Return True if the string is a numeric string, False otherwise.SortKey.isprintable(self, /)— Return True if all characters in the string are printable, False otherwise.SortKey.isspace(self, /)— Return True if the string is a whitespace string, False otherwise.SortKey.istitle(self, /)— Return True if the string is a title-cased string, False otherwise.SortKey.isupper(self, /)— Return True if the string is an uppercase string, False otherwise.SortKey.join(self, iterable, /)— Concatenate any number of strings.SortKey.ljust(self, width, fillchar=' ', /)— Return a left-justified string of length width.SortKey.lower(self, /)— Return a copy of the string converted to lowercase.SortKey.lstrip(self, chars=None, /)— Return a copy of the string with leading whitespace removed.SortKey.maketrans(...)— Return a translation table usable for str.translate().SortKey.partition(self, sep, /)— Partition the string into three parts using the given separator.SortKey.removeprefix(self, prefix, /)— Return a str with the given prefix string removed if present.SortKey.removesuffix(self, suffix, /)— Return a str with the given suffix string removed if present.SortKey.replace(self, old, new, /, count=-1)— Return a copy with all occurrences of substring old replaced by new.SortKey.rfind(...)— Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].SortKey.rindex(...)— Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].SortKey.rjust(self, width, fillchar=' ', /)— Return a right-justified string of length width.SortKey.rpartition(self, sep, /)— Partition the string into three parts using the given separator.SortKey.rsplit(self, /, sep=None, maxsplit=-1)— Return a list of the substrings in the string, using sep as the separator string.SortKey.rstrip(self, chars=None, /)— Return a copy of the string with trailing whitespace removed.SortKey.split(self, /, sep=None, maxsplit=-1)— Return a list of the substrings in the string, using sep as the separator string.SortKey.splitlines(self, /, keepends=False)— Return a list of the lines in the string, breaking at line boundaries.
Usage
import pstats
assert pstats.SortKey.CUMULATIVE == "cumulative"
assert pstats.SortKey.TIME == "tottime"
Gotchas
- Avoids typos in
stats.sort_stats(...):CUMULATIVEincludes callees;TIME(tottime) excludes callees.
REPL Inspect
from pstats import SortKey
help(SortKey)
Linked from
Related notes
- tuts/python3/stdlib_module/pstats/FunctionProfile Linked here; links to this page; shared tags: #pstats, #stdlib
- tuts/python3/stdlib_module/pstats/Stats Linked here; links to this page; shared tags: #pstats, #stdlib
- tuts/python3/stdlib_module/pstats/StatsProfile Linked here; links to this page; shared tags: #pstats, #stdlib
- tuts/python3/stdlib_module/pstats Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib