Dynamic scope in Python: https://github.com/agrif/parameterize Nifty and definitely useful when you need it.