[Python-Dev] any support for a methodcaller HOF?
mwh at python.net
Fri Feb 3 18:13:08 CET 2006
Jean-Paul Calderone <exarkun at divmod.com> writes:
> On Fri, 3 Feb 2006 07:00:26 -0800, Alex Martelli <aleaxit at gmail.com> wrote:
>>On Feb 3, 2006, at 6:47 AM, Giovanni Bajo wrote:
>>> use itemgetter and friends but the "correct" way of doing a
>>> defferred "x"
>>> *should* let you write "x" in the code. This is my main
>>> opposition to
>>> partial/itemgetter/attrgetter/methodcaller: they allow deferred
>>> using a syntax which is not equivalent to that of immediate execution.
>>I understand your worry re the syntax issue. So what about Michael
>>Hudson's "placeholder class" idea, where X returns the callable
>>that will do x when called, etc? Looks elegant to me...
I'd just like to point out here that I only mentioned this class; I
didn't suggest it for anything :)
Yow. My implementation was somewhere in between those for length, I
think (and pre-dated new style classes, which probably changes
I'm sorry, was my bias showing again? :-)
-- William Tanksley, 13 May 2000
More information about the Python-Dev