[Python-3000] A plea for anonymous functions

Ivan Krstić krstic at solarsail.hcs.harvard.edu
Thu Nov 16 09:33:23 CET 2006


Fredrik Lundh wrote:
> And frankly, it would be *wonderful* if someone could come up with a 
> new proposal that actually enabled Python programmers to do things they 
> *cannot* do today, instead of just rehashing old "let's move the sofa 
> over there" threads.  

Hear, hear.

> I want to get *new* things when I upgrade from 
> 2.X to 3.0, not just silly syntax tweaks that would only give me the 
> ability to change two lines of Python code to one line of code plus a 
> comment that explains what the heck that line is doing. 

>From my understanding of the purpose of 3.0, you're looking at the wrong
release. 3.0 is the "accumulated cruft removal" release, with features
becoming the focus of the 3.1 cycle and subsequent releases.

> Let's do some *hard* stuff, for a change.

I couldn't agree more. The fundamental problem that I see, though, is
that Guido seems strongly opposed to adding any additional
metaprogramming features to the language [0], and solving much of the
hard stuff elegantly and without special-cased, one-off solutions,
requires these.

LINQ-like features certainly require having first-class code blocks. And
for a couple of months, I've been jotting down notes, in preparation for
a PEP, on how best to add multiprocessing support to Python given the
GIL and the fact that it's not going away in the near future. There are
a number of attractive solutions -- some of them quite beautiful, and I
can provide examples -- that can be used here, but they all make the
same requirement as LINQ if they're to not look like utter warts.

The bottom line, I think, is that we need generic language support for
"hard stuff", and as Lispers figured out a while back, that support /is/
metaprogramming. Guido does not wish to make Python syntax any more
programmable, however, while at the same time features like metaclasses
tempt us just enough to feel the possibilities are within reach.




[0] See second to last paragraph:
http://mail.python.org/pipermail/python-3000/2006-April/000286.html

-- 
Ivan Krstić <krstic at solarsail.hcs.harvard.edu> | GPG: 0x147C722D


More information about the Python-3000 mailing list