Python-list digest, Vol 1 #10324 - 13 msgs

Laura Creighton lac at strakt.com
Fri Apr 5 09:18:12 EST 2002


> On Thu, 2002-04-04 at 18:08, python-list-request at python.org digested:
> 
> > >I would like to be able to define anonymous functions and classes by
> > >omitting the function or class name normally found after the def or
> > >class keyword. 
> > 
> > Feel free to write a PEP so that this abomination can be rejected once
> > and for all.  ;-)  (I don't think there have been any large threads on
> > this in 2002, but there certainly were at least two or three in 2001.)
> 
> I might create the PEP for posterity's sake. Should I dub it the
> 'sacrificial PEP'?

not _The_ -- I have beaten you to it.  See PEP 
http://www.python.org/peps/pep-0666.html  (ps, it's funny).

> 
> > (Yes, I can be quite certain it will be rejected, given Guido's regret
> > over including lambda in the first place.  Python has rightly included
> > many useful bits from functional programming languages, but Python is
> > also emphatically *NOT* a functional language itself.)
> 
> This is interesting news to me since I've been picking Python habits up
> from the latest edition of Programming Python and which uses lambda a
> fair amount. Specifically, I've been using them in my Tkinter programs
> to pass extra parameters to my event handlers. Is it more proper
> (Pythonic) to def the helper function first and pass the helper function
> name second?

Lots of Tkinter programmers, including me, would say no.   There is also
a third approach -- Gustavo Cordoba's : see  
http://groups.google.com/groups?q=comp.lang.python+Tkinter+callback&hl=en&scoring=d&selm=mailman.1017245242.12269.python-list%40python.org&rnum=4

(last month).

Laura Creighton






More information about the Python-list mailing list