Marc D.M. wrote:
> On Wed, 2006-09-06 at 22:49 -0700, Michael Spencer wrote:
>> If you're really hunting for speed, there is a significant boost available
>> in
>> the common special case of a python function curried with one positional
>> argument. In this case, you can [ab]use the method bin
Marc D.M. wrote:
> On Thu, 2006-09-07 at 13:28 -0500, Adrian Holovaty wrote:
>> On 9/7/06, Michael Spencer <[EMAIL PROTECTED]> wrote:
>>
>>> If you're really hunting for speed, there is a significant boost available
>>> in
>>> the common special case of a python function curried with one positio
On Thu, 2006-09-07 at 13:28 -0500, Adrian Holovaty wrote:
> On 9/7/06, Michael Spencer <[EMAIL PROTECTED]> wrote:
> > Martin's version is indeed faster, but has a 'gotcha' in that it precludes
> > passing a keyword arguments named 'fct' to a curried function...
> > [...]
> > Better to rename fct t
On 9/7/06, Michael Spencer <[EMAIL PROTECTED]> wrote:
> Martin's version is indeed faster, but has a 'gotcha' in that it precludes
> passing a keyword arguments named 'fct' to a curried function...
> [...]
> Better to rename fct to something less likely to clash, such as _curried_fct
Good call, M
On 9/7/06, Michael Spencer <[EMAIL PROTECTED]> wrote:
> Martin's version is indeed faster, but has a 'gotcha' in that it precludes
> passing a keyword arguments named 'fct' to a curried function...
If you look at the changeset checked in by Adrian[1], it's slightly
different than Martin's origina
On Wed, 2006-09-06 at 22:49 -0700, Michael Spencer wrote:
> If you're really hunting for speed, there is a significant boost available in
> the common special case of a python function curried with one positional
> argument. In this case, you can [ab]use the method binding machinery, e.g.:
>
>
Adrian Holovaty wrote:
> On 9/6/06, Martin <[EMAIL PROTECTED]> wrote:
>> def curry(fct, *args, **kwargs):
>> def _curried(*moreargs, **morekwargs):
>> return fct (* (args+moreargs), **dict(kwargs, ** morekwargs))
>> return _curried
>>
>> It's just a performance issue (saving a few
On 9/6/06, Martin <[EMAIL PROTECTED]> wrote:
> def curry(fct, *args, **kwargs):
> def _curried(*moreargs, **morekwargs):
> return fct (* (args+moreargs), **dict(kwargs, ** morekwargs))
> return _curried
>
> It's just a performance issue (saving a few list operations) andbecause
> I
Just because I stubled on the code of curry (I had to find out what
this function really does).
It's not a big of a deal, but I think it would be better to change the
function from the current implementation:
def curry(*args, **kwargs):
def _curried(*moreargs, **morekwargs):
return a