Created
June 13, 2015 17:25
-
-
Save amjith/5c5ffdbf06fecf9e4897 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from contextlib import contextmanager | |
import sys | |
@contextmanager | |
def export(): | |
print "Enter:" | |
yield | |
print sys._getframe(2).f_locals | |
print "Exit" | |
class Foo(object): | |
def set_foo(self, val): | |
self.val = val | |
with export(): | |
bar = Foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment