PEP 309 - Built-in closure type (with tentative syntax proposal)
James J. Besemer
jb at cascade-sys.com
Mon Feb 10 23:36:23 EST 2003
Peter Harris wrote:
> So you can freeze a function or other callable with a partial
> argument list and keyword arguments into a handy callable
> object.
>
> [...]
>
> The syntax proposal is more controversial. I want a function
> call operator @(*args,**kw) that instead of invoking __call__ on its
> left argument, returns a closure object.
>
> [...]
>
> I'm a great fan of concise syntax, and this really appeals to me,
> but what is the community view? Does python need a closure type?
> Is the @ syntax too ugly to be worth it?
I have no strong feelings either way towards your PEP. Off hand, it strikes
me as not all that far removed from generators, which are already in the
language. (Though I question if "self.args+args" is really what should be in
the last line of the reference implementation.)
But I gotta wonder -- if people are having SO MUCH trouble with a trivial
little thing like PEP 308, it would strike me as hypocritical of them to
endorse this one.
<<most of the same rhetorical arguments apply equally well here>>
Then too, the subject your PEP is sufficiently complex that many people who
presently express a strong opinion on PEP 308 might remain silent about
number 309.
Best o' luck.
Regards
--jb
--
James J. Besemer 503-280-0838 voice
2727 NE Skidmore St. 503-280-0375 fax
Portland, Oregon 97211-6557 mailto:jb at cascade-sys.com
http://cascade-sys.com
More information about the Python-list
mailing list