Allow a function to discover the module or script name of its caller, or its caller's caller.
Project description
stackclimber allows your function to find the module or script name of its caller, or of its caller’s caller.
from stackclimber import stackclimber
assert stackclimber() == __name__
assert stackclimber() == stackclimber(0)
With no arguments, it finds the current function’s module name. With 1, it finds that of its caller; with 2, that of its caller’s caller, and so forth.
This functionality can be used to implement “automatic” imports that use some information about the module into which they are being imported by overriding a module’s __getattr__.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stackclimber-0.99.tar.gz
(1.9 kB
view details)
File details
Details for the file stackclimber-0.99.tar.gz
.
File metadata
- Download URL: stackclimber-0.99.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fd97bd67c927d055d5b43bfcb0ed1a7c7c7ab084099aaf68452a0c881173bc9 |
|
MD5 | e59d388fb4854e5368d40e88f6727bab |
|
BLAKE2b-256 | 54367fae81f35794423f82eaee6e206b35b6d10cf070e351661e9eb1077dc53a |