Skip to main content

Convenience functions for the python execution stack.

Project description

I find the supplied python traceback facilities quite awkward. These functions provide convenient facilities.

Function caller(frame_index=-3)

Return the Frame of the caller's caller.

Useful frame_index values:

  • -1: caller, this function
  • -2: invoker, who wants to know the caller
  • -3: the calling function of the invoker

Class Frame

MRO: Frame, builtins.tuple
Namedtuple for stack frame contents.

Function frames()

Return the current stack as a list of Frame objects.

Function stack_dump(fp=None, indent=0, Fs=None)

Recite current or supplied stack to fp, default sys.stderr.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cs.py.stack-20190101.tar.gz (2.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page