Skip to content

Instantly share code, notes, and snippets.

@mnuck
Created March 8, 2012 04:38
Show Gist options
  • Save mnuck/1998724 to your computer and use it in GitHub Desktop.
Save mnuck/1998724 to your computer and use it in GitHub Desktop.
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