Re: [Python-Dev] Why not make frames? [was: Alternative forms [was: PEP 463: Exception-catching expressions]]

2014-03-12 Thread R. David Murray
On Mon, 10 Mar 2014 14:26:14 +1100, Chris Angelico ros...@gmail.com wrote: On Mon, Mar 10, 2014 at 1:16 PM, Jim J. Jewett jimjjew...@gmail.com wrote: I don't claim that syntax is perfect. I do think it is less flawed than the no-parentheses (or external parentheses) versions: (expr1

Re: [Python-Dev] Why not make frames? [was: Alternative forms [was: PEP 463: Exception-catching expressions]]

2014-03-11 Thread Ethan Furman
On 03/09/2014 07:16 PM, Jim J. Jewett wrote: because I cannot imagine reading an embedded version of either of those without having to mentally re-parse at the colon. An example assuming a precedence level that may not be what the PEP proposes: if myfunc(5, expr1 except expr2: expr3,

[Python-Dev] Why not make frames? [was: Alternative forms [was: PEP 463: Exception-catching expressions]]

2014-03-09 Thread Jim J. Jewett
TL;DR: expr except (default if exc_expr) expr (except default if exc_expr) expr except (exc_expr: default) expr (except exc_expr: default) (1) Group the exceptions with the default they imply. (2) inline-: still needs () or [] or {}. (3) Consider the expression inside a

Re: [Python-Dev] Why not make frames? [was: Alternative forms [was: PEP 463: Exception-catching expressions]]

2014-03-09 Thread Chris Angelico
On Mon, Mar 10, 2014 at 1:16 PM, Jim J. Jewett jimjjew...@gmail.com wrote: On Fri Mar 7 20:54:31 CET 2014, Chris Angelico wrote: I don't see except expressions as fundamentally more associated with if/else than with, say, an or chain, which works left to right. I do, because of the skipping