nick coughlan wrote:<div>> No, the idea is for the indented suite to be a perfectly normal suite<br>> of Python code. We want to be able to define functions, classes, etc<br>> in there.<br>@Chris Robert</div><div>

sorry what i meant in saying that</div><div>" a_variable = an_expression" is that, it seems to me, at least, the only allowed </div><div>statements are ones where a variable is set to a value, which includes "class" and "def"</div>

<div>(and some control flow, if, else etc.)</div><div><br></div><div>also in the first post:</div><div>Sergio Davis wrote:</div><div>><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">I'm considering the following extension to Python's grammar: adding the 'where' keyword, which would work as follows:</span></div>

<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">><br>>where_expr : expr 'where' NAME '=' expr</span><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>

</span></font><div><div class="gmail_quote">On Tue, Jul 20, 2010 at 10:56 PM, Chris Rebert <span dir="ltr"><<a href="mailto:pyideas@rebertia.com">pyideas@rebertia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Tue, Jul 20, 2010 at 7:50 PM, Alex Light <<a href="mailto:scialexlight@gmail.com">scialexlight@gmail.com</a>> wrote:<br>
> Carl M. johnson wrote:<br>
>>2.) What happens in this case:<br>
>><br>
>>x = y given:<br>
>>    return "???"<br>
>><br>
>>Do we just disallow return inside a given? If so, how would the parser<br>
>>know to allow you to do a def inside a given?<br>
> i think so because unless i am misunderstanding something the only allowed<br>
> expressions<br>
> in a 'given' block would be of the type:<br>
> a_variable = an_expression<br>
<br>
</div>Incorrect. Yes, you are misunderstanding:<br>
<div class="im"><br>
On Tue, Jul 20, 2010 at 3:13 PM, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br>
> On Wed, Jul 21, 2010 at 6:13 AM, Alex Light <<a href="mailto:scialexlight@gmail.com">scialexlight@gmail.com</a>> wrote:<br>
</div><div class="im">>> i would use as because this whole where clause acts very similarly to a<br>
>> context manager in that it sets a variable to a value for a small block<br>
><br>
> No, the idea is for the indented suite to be a perfectly normal suite<br>
> of Python code. We want to be able to define functions, classes, etc<br>
> in there. Inventing a new mini-language specifically for these clauses<br>
> would be a bad idea (and make them unnecessarily hard to understand)<br>
</div><snip><br>
> Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>   |   Brisbane, Australia<br>
<br>
Did you not read Nick's reply yet when you wrote this, or...?<br>
<br>
Cheers,<br>
Chris<br>
<font color="#888888">--<br>
<a href="http://blog.rebertia.com" target="_blank">http://blog.rebertia.com</a><br>
</font></blockquote></div><br></div></div>