Created
May 10, 2012 13:33
-
-
Save averrin/2653018 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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