[Python-ideas] Quick Lambdas and Partials (Re: A suggestion for Python 3 vs Python 2)

Ian Cordasco graffatcolmingov at gmail.com
Thu Nov 14 13:37:19 CET 2013


On a related note, I've been intrigued by Haskell's idea of currying
all functions, and have an implementation that works for pure
functions but not for callable classes or methods over on
https://github.com/sigmavirus24/curryer.

On Thu, Nov 14, 2013 at 4:45 AM, Andrew Barnert <abarnert at yahoo.com> wrote:
> I think the discussions on expression-template quick lambdas and auto-partialing functions are both way off topic for the thread about changing Python syntax to allow function calls without parens (or just print, or whatever). And I don't think they really belong on python-ideas at all (unless someone has a suggestion for language or stdlib support for either, which seems unlikely).
>
> Since I started both ideas, the derailing is entirely my fault.
>
> Anyway, if anyone's interested, I slapped together a quick implementation of each idea. https://github.com/abarnert/quicklambda is incomplete, but playable-with; https://github.com/abarnert/quickpartial is not working at all (in fact, I haven't even pushed a commit yet).
>
>>>  On Nov 13, 2013, at 20:17, Haoyi Li <haoyi.sg at gmail.com> wrote:
>
>
>>>> I personally like the _ notation used by scala; with macros you could
>>>> easily write something like:
>>>>
>>>> f[spam(_, 5)]
>>>> f[spam(_, n=_)]
>
>>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas


More information about the Python-ideas mailing list