[Python-Dev] Dinamically set __call__ method
skip.montanaro at gmail.com
Tue Nov 4 20:06:04 CET 2014
On Tue, Nov 4, 2014 at 1:01 PM, Roberto Martínez <robertomartinezp at gmail.com
> The workaround of calling a different method inside __call__ is not valid
> for my case because I want to change the *signature* of the function also
> -for introspection reasons.
You could define __call__ like so:
def __call__(self, *args, **kwds):
then set self._my_call at runtime.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list