Message211973
Here is a preliminary implementation of PEP 463, minus mandatory parentheses and with the most straightforward precedence rule: equal to if-expr -- which means this:
A if C else B except E: D
is parsed as
A if C else (B except E: D)
(because of associativity, not precedence) and not as
(A if C else B) except E: D
as suggested by the PEP with the hand-wavy words 'between lambda and if/else in precedence'. The latter is possible but means a little more hoop-jumping in the grammar.
The tests included are rudimentary (at the end of test_grammar.py) and could probably do with some fleshing out, partially as tests and partially to try out how the precedence rules work out in practice. |
|
Date |
User |
Action |
Args |
2014-02-22 23:56:57 | twouters | set | recipients:
+ twouters |
2014-02-22 23:56:57 | twouters | set | messageid: <1393113417.21.0.308711390279.issue20739@psf.upfronthosting.co.za> |
2014-02-22 23:56:57 | twouters | link | issue20739 messages |
2014-02-22 23:56:56 | twouters | create | |
|