Re: Using lambda [was Re: Article of interest: Python pros/cons for theenterprise]

2008-02-25 Thread Duncan Booth
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> but if >> you pass functions/lambdas around a lot it can be frustrating when you >> get an error such as: >> >> TypeError: () takes exactly 2 arguments (1 given) >> >> and the traceback only tells you which line generated the TypeError, not >> wh

Re: Using lambda [was Re: Article of interest: Python pros/cons for theenterprise]

2008-02-25 Thread Steven D'Aprano
On Mon, 25 Feb 2008 15:12:23 +, Duncan Booth wrote: > I take it you never feel the need to inspect tracebacks, nor insert a > breakpoint or print statement at an arbitrary point in the code. Nah, my code is always perfect, first time, every time. *wink* > Granted none of those may apply i

Re: Using lambda [was Re: Article of interest: Python pros/cons for theenterprise]

2008-02-25 Thread Duncan Booth
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 24 Feb 2008 21:13:08 -0500, Terry Reedy wrote: > >> | I even use "named anonymous functions" *cough* by assigning lambda | >> functions to names: >> | >> | foo = lambda x: x+1 >> >> Even though I consider the above to be clearly inferior to >

Re: Using lambda [was Re: Article of interest: Python pros/cons for theenterprise]

2008-02-25 Thread Steven D'Aprano
On Sun, 24 Feb 2008 21:13:08 -0500, Terry Reedy wrote: > | I even use "named anonymous functions" *cough* by assigning lambda | > functions to names: > | > | foo = lambda x: x+1 > > Even though I consider the above to be clearly inferior to > > def foo(x): return x+1 > > since the latter names

Re: Using lambda [was Re: Article of interest: Python pros/cons for theenterprise]

2008-02-24 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Sat, 23 Feb 2008 19:35:30 -0800, Jeff Schwab wrote: | | > Every time somebody uses | > lambda here, they seem to get a bunch "why are you using lambda?" | > responses. I think you are overgeneralizing ;-) I use 'e