Re: [Python-ideas] Syntax for curried functions
2 Mar
2009
2 Mar
'09
9:07 p.m.
Steven D'Aprano wrote:
Weeble wrote:
Would this be crazy? Make this:
def spam(a,b,c)(d,e,f): [BODY]
a synonym for:
def spam(a,b,c): def spam2(d,e,f): [BODY] return spam2
As far as I can tell, it would always be illegal syntax right now, so it seems a safe change. And it would make it cleaner to write higher order functions.
I don't think it would. Your proposed syntax is only useful in the case that the outer function has no doc string and there's no pre-processing or post-processing of the inner function, including decorators.
Fair enough. I knew I must be overlooking something. Sturla Molden wrote:
This is atrocious.
:'( Sorry. I thought it might be a bit of a crazy idea. I didn't think it was that bad!
5532
Age (days ago)
5532
Last active (days ago)
0 comments
1 participants
participants (1)
-
Weeble