I find the supplied python traceback facilities quite awkward. These functions provide convenient facilities.
Latest release 20240412:
- stack_dump: new select parameter to pick interesting frames for the listing.
- Provide StackSummary and FrameSummary if Python too old.
Function caller(frame_index=-3)
Return the Frame of the caller's caller.
Returns None if frame_index is out of range.
Useful frame_index values:
-1: caller, this function-2: invoker, who wants to know the caller-3: the calling function of the invoker
The default from_index value is -3.
Function frames()
Return the current stack as a list of Frame objects.
Function stack_dump(f=None, indent=0, frames=None, skip=None, select=None, format_frame=None)
Recite current or supplied stack to f, default sys.stderr.
Parameters:
f: the output file object, defaultsys.stderrindent: how many spaces to indent the stack lines, default0frames: the stackFrames to write, default obtained from the current stackskip: the number ofFrames to trim from the end offrames; ifframesisNonethis defaults to2to trim theFrames for thestack_dumpfunction and its call toframes(), otherwise the default is0to use the suppliedFrames as isselect: if notNone, select particular frames; ifselectis astrit must be present in the frame filename; otherwiseselect(frame)must be true
Release Log
Release 20240412:
- stack_dump: new select parameter to pick interesting frames for the listing.
- Provide StackSummary and FrameSummary if Python too old.
Release 20220918: caller(): return None if the frame offset is out of range.
Release 20220429: caller: return None if the stack index is out of range.
Release 20190812: stack_dump(): trim the last 2 frames from the listing by default (they are part of stack_dump's implementation).
Release 20190101:
- _Frame: rename .functionname to .funcname; caller: turn raw frames into Frames.
- caller(): accept optional frame_index, default -3.
Release 20160827: Add stack_dump().
Release 20150115: PyPI metadata fixups.
Release 20150111: Tag for initial PyPI release of cs.py.stack.
Metadata
Release files for cs-py-stack 20240412
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cs.py.stack-20240412.tar.gz | 3.7 kB | Without provenance | Details for cs.py.stack-20240412.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cs.py.stack-20240412-py3-none-any.whl | Python 3 | none | any | Details for cs.py.stack-20240412-py3-none-any.whl |
Total release size: 7.7 kB
Release files / cs.py.stack-20240412.tar.gz
| Download URL | cs.py.stack-20240412.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa84eab63100e375fc286626b68b3c8b4c09db101d52b6572ae98835c3c16870
|
|
BLAKE2b-256 checksum How to use checksums |
f5038ede2fc10ea7e2573112fae8fb44c4866acd6fc0b10c0dde29920a5fc1da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.6
|
Release files / cs.py.stack-20240412-py3-none-any.whl
| Download URL | cs.py.stack-20240412-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf1b9d706e40f4a79ba23cc7b92123a4b9e448397b76208279eeb521ddc8656c
|
|
BLAKE2b-256 checksum How to use checksums |
3a0bde02e3753a060a987a17472dbdbf846b4168d72d9f01e5f165c50a76144c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.6
|
Security for cs-py-stack 20240412
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.