[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Closing this for the reasons mentions above. -- resolution: -> rejected status: open -> closed ___ Python tracker ___ __

[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would rather leave lambda or plain function definitions as the way to handle any cases not covered by itergetter, attrgettr, and methodcaller. It feels like we're working way too hard to produce more ways to do it. Also, the suggested use cases with

[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-27 Thread Josh Rosenberg
Josh Rosenberg added the comment: I could see the argument for this to make methodcaller more like an unbound version of functools.partial. Partial lets you prebind some things and not others, you might want to do the same thing with methods, where you prebind the method name and some argument

[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: This would be easier to evaluate propertly if you supplied some meaningful use cases. Otherwise, it is looks like hypergeneralizing. -- nosy: +rhettinger ___ Python tracker __

[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-25 Thread Evgeny Kapun
Evgeny Kapun added the comment: There are methods that accept a single argument and behave like a binary operation or a predicate. It would be useful to be able to turn them into binary functions for use with higher-order functions like map and reduce: reduce(methodcaller("combine"), objs)

[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-21 Thread Evgeny Kapun
New submission from Evgeny Kapun: Currently, operator.methodcaller behaves like this: def methodcaller(name, *args, **kwargs): def caller(obj): return getattr(obj, name)(*args, **kwargs) return caller That is, it is possible to supply arguments when the object is