PEP 309 - Built-in closure type (with tentative syntax proposal)

Alex Martelli aleax at aleax.it
Mon Feb 10 17:16:23 EST 2003


Peter Harris wrote:
   ..
> The syntax proposal is more controversial. I want a function

You called that right.

> call operator @(*args,**kw) that instead of invoking __call__ on its
> left argument, returns a closure object.

I suggest you take the infernal regions' temperatures daily,
and come back when they're hovering very close to 0 centigrade.

> but what is the community view? Does python need a closure type?

It wouldn't be a bad idea, except for the name (which should
be curry, not 'closure').  The type should live in a standard
library module -- it's not going to be used often enough to
make it a built-in.

> Is the @ syntax too ugly to be worth it?

It's ugly, unpythonic, and absolutely unwarranted besides:
introducing totally new syntax for a "nice to have" thingy
that, in my view, isn't even worth adding as a built-in
(though I wouldn't scream too loud if that happened, but
I'd prefer it to be in the standard library), would IMHO
be absurd, and I confidently predict it will never happen.

If you do hope the new type to happen, I suggest you drop
the idea of changing the language syntax to accomodate it,
and lobby just for the _semantics_ you need, instead.


Alex





More information about the Python-list mailing list