Extending Python Syntax with @
Cameron Laird
claird at lairds.com
Thu Mar 11 10:35:11 EST 2004
In article <1050uf4afdkrje5 at news.supernews.com>,
John Roth <newsgroups at jhrothjr.com> wrote:
.
.
.
>I tend to agree, but for slightly different reasons. Lambdas
>are a means of in-lining a function definition. However, they
>are so restricted that we constantly get suggestions for
>"improving" them by adding more syntax.
>
>Given the restrictions, I see the natural growth path as leading
>to a callable instance or a bound method, not a module level
>function. Module level functions are a distraction; usually you
>want to interface with an object, and module level functions make
>that very difficult.
>
>The other reason to avoid lambdas is the DRY principle:
>Don't Repeat Yourself. Most uses of lambdas I've seen
>lead to duplication in anything larger than a toy program.
>
>What I'd really like is for all of the instructional material
>with lambdas to just magically vanish and be replaced by
>instructional material that does whatever it is in proper
>object oriented fashion, using bound methods for callbacks.
>Relegate lambda to a sidebar.
.
.
.
I like what you've written, and the way you've written it,
better than what I had. It's absolutely more Pythonic to
emphasize clarity, expressiveness, AND instance association
as better-localized binding.
That sounds like a project: sanitization of introductory
materials for misleading lambdas.
--
Cameron Laird <claird at phaseit.net>
Business: http://www.Phaseit.net
More information about the Python-list
mailing list