Skip to content

Instantly share code, notes, and snippets.

@averrin
Created May 10, 2012 13:33
Show Gist options
  • Select an option

  • Save averrin/2653018 to your computer and use it in GitHub Desktop.

Select an option

Save averrin/2653018 to your computer and use it in GitHub Desktop.
class test(object):
def __init__(self):
self._t1 = "%(conditions)s"
self._t2 = '%s'
self._createProcs()
def _createProcs(self):
for q in self.__dict__.copy():
self.__setattr__(q[1:],
lambda **kwargs:
(self.__getattribute__(q) % kwargs, kwargs, self.__dict__, self.__getattribute__(q), q))
print test().t1(conditions='where 1=2 and 2=3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment