Created
March 8, 2012 04:38
-
-
Save mnuck/1998724 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
class fakeGlobal(object): | |
def __init__(self, f): | |
self.f = f | |
self.__name__ = f.__name__ | |
def __call__(self, *args): | |
global derpadil | |
derpadil = "blarg" | |
retval = self.f(*args) | |
del derpadil | |
return retval | |
@fakeGlobal | |
def blurf(): | |
print derpadil | |
blurf() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment