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