Using the Python Interpreter as a Reference
Neil Cerutti
neilc at norwich.edu
Mon Nov 28 15:20:36 EST 2011
On 2011-11-28, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> I think the implication is that Unit has only one syntax for
> creating functions, which is lambda-style. In any case, why
> does Python require a special keyword? def is only used in a
> statement context, and lambda is only used in an expression
> context. Why not use the same keyword for both? I think the
> answer is historical: def came first, and when anonymous
> functions were added it didn't make sense to use the keyword
> "def" for them, because "def" implies a name being defined.
I've always held with the "anti-functional style conspiracy"
interpretation of Python's lambda expressions. They were added
but grudgingingly, made weak on purpose to discourage their use.
--
Neil Cerutti
"This room is an illusion and is a trap devisut by Satan. Go
ahead and dauntlessly! Make rapid progres!"
--Ghosts 'n Goblins
More information about the Python-list
mailing list