On 2/12/07, Brett Cannon <brett at python.org> wrote: > They all sound reasonable. And it's nice to have a wanted feature be > found from actual use. =) I've just uploaded patch #1659410 to SF, implementing the changes I outlined: 1) I changed some of the code emitted by asdl_c.py so _fields is always a tuple. Where _fields used to be None, it's now a 0-element tuple. 2) It turned out that {BinOp, BoolOp,AugAssign,etc}.op were already singleton instances of their respective classes. I've changed asdl_c.py to no longer emit the *_singleton names and to use the corresponding *_type types in their place, which will enable me to write "node.op is _ast.Add", etc. 3) Adding an Else node was a little more involved, but it proved do-able. TryFinally.orelse, While.orelse, For.orelse and If.orelse can now be either None or an instance of Else. Else instances have a 'body' attribute, which is a sequence of statements. Thanks, Collin Winter
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4