On Jun 12, 10:12 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 12 Jun., 14:57, Facundo Batista <[EMAIL PROTECTED]> wrote: > > > Remember that the *only* difference between the two functions is that > > one is anonymous, and for other you have to came up with a name (name > > that if is well thought, actually adds readibility to your code). > > The difference is that one can be inlined since it is an expression > and the other has to be a statement and a reusable ( named ) > abstraction even when you don't need one. I have a very hard time to > defend this as a good design decision even when it is just a minor > pain point in almost all my practical purposes.
I think of it more as a "necessary evil" rather than a conscious design choice. IIRC the "official" justification is that nobody came up with an acceptable syntax for multiline lambdas; TOOWTDI is a secondary reason (as one can easily come up with a dozen TOOWTDI violations in other parts of the language). I agree though that in practice it's a very small limitation. George -- http://mail.python.org/mailman/listinfo/python-list