[Python-Dev] a different kind of reduce...
Simon Percivall
s.percivall at chello.se
Wed Nov 2 00:14:20 CET 2005
On 1 nov 2005, at 22.40, Guido van Rossum wrote:
>> [Greg Ewing]
>>> Maybe ** should be defined for functions so that you
>>> could do things like
>>>
>>> up3levels = dirname ** 3
>
> [Raymond Hettinger]
>> Hmm, using the function's own namespace is an interesting idea. It
>> might also be a good place to put other functionals:
>>
>> results = f.map(data)
>> newf = f.partial(somearg)
>
> Sorry to rain on everybody's parade, but I don't think so. There are
> many different types of callables. This stuff would only work if they
> all implemented the same API. That's unlikely to happen. A module with
> functions to implement the various functional operations has much more
> potential.
Perhaps then a decorator that uses these functions?
//Simon
More information about the Python-Dev
mailing list