Why can function definitions only use identifiers, and not attribute references or any other primaries?

John Krukoff jkrukoff at ltgc.com
Thu Apr 23 18:03:40 CEST 2009


On Thu, 2009-04-23 at 12:26 -0300, Jeremy Banks wrote:
> > Things like your suggestion are called "syntactic-sugar"  -- syntax that
> > adds a convenience, but *no* new functionality.  Python has plenty of
> > "syntactic-sugar"s, and more will be added in the future.  To make an
> > argument for such an addition, one would have to describe some compelling
> > (and general) use cases in a well-argued PEP.  You're welcome to try, but be
> > forewarned, most PEP's (especially syntax changing PEPs) don't fly far.
> 
> Thank you very much for the feedback. I might throw something at
> Python-Ideas if I think I can come up with an adequate justification
> and don't come accross a previous similar propsition (though if I do
> miss it I'm sure it will be pointed out to me fairly quickly). I fully
> appreciate the small chance of success, but it certainly couldn't hurt
> to give it a try.
> --
> http://mail.python.org/mailman/listinfo/python-list

You probably want to be searching for multi-line lambda to find the past
decade or so of this argument, as that's where most people who argued
for this came from. But, if you'd just like a bit of discouragement,
here's GvR arguing that there's just no good way to mix statements and
expressions in python:
http://www.artima.com/weblogs/viewpost.jsp?thread=147358

-- 
John Krukoff <jkrukoff at ltgc.com>
Land Title Guarantee Company




More information about the Python-list mailing list