[Python-ideas] Syntax to help with currying

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Mar 10 08:53:28 CET 2007


Brett Cannon wrote:
>    def register(cls, account_id, form_id):
>        def inner(to_decorate):
>            ...
>         return inner

Thinking the other day about how this pattern arises quite
frequently when doing currying like this, and wondering
what sort of syntax might make it easier, I came up with

   def f():
     return g():
       ...

--
Greg



More information about the Python-ideas mailing list