diff --git a/twython/twython.py b/twython/twython.py index 7cb67f4..f390a62 100644 --- a/twython/twython.py +++ b/twython/twython.py @@ -176,8 +176,10 @@ class Twython(object): # If they don't do authentication, but still want to request unprotected resources, we need an opener. self.client = httplib2.Http(**client_args) # register available funcs to allow listing name when debugging. + def setFunc(key): + return lambda **kwargs: self._constructFunc(key, **kwargs) for key in api_table.keys(): - self.__dict__[key] = lambda **kwargs: self._constructFunc(key, **kwargs) + self.__dict__[key] = setFunc(key) def _constructFunc(self, api_call, **kwargs): # Go through and replace any mustaches that are in our API url. @@ -503,4 +505,4 @@ class Twython(object): def encode(text): if isinstance(text, (str,unicode)): return Twython.unicode2utf8(text) - return str(text) \ No newline at end of file + return str(text)