Re: [Python-Dev] small Grammar questions

2008-02-19 Thread Brett Cannon
On Feb 19, 2008 6:15 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > [...] > > The one that surprised me was the legality of > > > > def eggs((a, )=c): > > pass > > > > That just seems like unpacking-abuse to me. > > > Needless to say, a call that tries to *use* th

Re: [Python-Dev] small Grammar questions

2008-02-19 Thread Andrew Dalke
Okay, my conclusion is def f((a)=5) is wrong, and the code should be changed to report a better error message. I'll file a bug against that. and I'm going with Brett suggestion that [x for x in 1,] is not supported because it's almost certainly a programming error. I think therefore the

Re: [Python-Dev] small Grammar questions

2008-02-19 Thread Steve Holden
Steve Holden wrote: [...] > The one that surprised me was the legality of > > def eggs((a, )=c): > pass > > That just seems like unpacking-abuse to me. > Needless to say, a call that tries to *use* the default value fails horribly, as the parameter form does require an iterable:

Re: [Python-Dev] small Grammar questions

2008-02-19 Thread Steve Holden
Andrew Dalke wrote: > On Feb 19, 2008 1:38 PM, Andrew Dalke <[EMAIL PROTECTED]> wrote: >> def spam((a) = c): >> print a > > On Feb 20, 2008 12:29 AM, Brett Cannon <[EMAIL PROTECTED]> wrote: [..] >> Are you asking why the decision was made to make the expression >> illegal, or why the grammar is

Re: [Python-Dev] small Grammar questions

2008-02-19 Thread Andrew Dalke
On Feb 19, 2008 1:38 PM, Andrew Dalke <[EMAIL PROTECTED]> wrote: > def spam((a) = c): > print a On Feb 20, 2008 12:29 AM, Brett Cannon <[EMAIL PROTECTED]> wrote: > The error might be odd, but I don't see why that should be allowed > syntax. Having a parameter surrounded by a parentheses like tha

Re: [Python-Dev] small Grammar questions

2008-02-19 Thread Brett Cannon
On Feb 19, 2008 1:38 PM, Andrew Dalke <[EMAIL PROTECTED]> wrote: > I'm finishing up a PLY lexer and parser for the current CVS version of > the Python grammar. As part of it I've been testing a lot of dark > corners in the grammar definition and implementation. Python 2.5 has > some small and rar

[Python-Dev] small Grammar questions

2008-02-19 Thread Andrew Dalke
I'm finishing up a PLY lexer and parser for the current CVS version of the Python grammar. As part of it I've been testing a lot of dark corners in the grammar definition and implementation. Python 2.5 has some small and rare problems which I'm pleased to note have been pretty much fixed in Pytho