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, Michael. I've renamed the parameter to '_curried_func' in changeset 3735. > 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.: > [...] > This is about twice as fast as curry2 for the case of a python function > curried > with one argument. It also offers better introspection than either curry1 or > curry2, since the original signature is preserved. It's a bigger change than > the curry2 though, since it changes the type of the curry from function to > bound > method. I was with you until "it changes the type of the curry from function to bound method." How does it do that? Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---