Skip to content

drcloud/stackclimber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stackclimber

https://travis-ci.org/drcloud/stackclimber.svg?branch=master

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__.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages