Skip to content

Instantly share code, notes, and snippets.

@fish2000
Created September 30, 2010 05:31
Show Gist options
  • Save fish2000/604081 to your computer and use it in GitHub Desktop.
Save fish2000/604081 to your computer and use it in GitHub Desktop.
example of python closures
def cl_get(what=None):
def cl(self, yodogg):
print u"cl_get(what): %s" % what
print u"cl.func_name: %s" % cl.func_name
print u"cl(self) type: %s" % type(self)
print u"cl(yodogg): %s" % yodogg
return cl
class Stuff(Thingy):
@staticmethod
def stuffing():
def mystuff(stuffit, *args, **kw):
print "I STUFFED IT: %s" % stuffit
return mystuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment