Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r44987:73d001b38029 Date: 2011-06-17 14:29 +0200 http://bitbucket.org/pypy/pypy/changeset/73d001b38029/
Log: And while we're at it, attack methodcaller() too. diff --git a/pypy/module/operator/app_operator.py b/pypy/module/operator/app_operator.py --- a/pypy/module/operator/app_operator.py +++ b/pypy/module/operator/app_operator.py @@ -116,12 +116,7 @@ return builtinify(getter) -class methodcaller(object): - - def __init__(self, method_name, *args, **kwargs): - self.method_name = method_name - self.args = args - self.kwargs = kwargs - - def __call__(self, obj): - return getattr(obj, self.method_name)(*self.args, **self.kwargs) +def methodcaller(method_name, *args, **kwargs): + def call(obj): + return getattr(obj, method_name)(*args, **kwargs) + return builtinify(call) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit