
Guido van Rossum wrote:
On Mon, Sep 28, 2015 at 12:47 PM, Andrew Barnert <abarnert@yahoo.com <mailto:abarnert@yahoo.com>> wrote:
Expr( value=Attribute( value=Attribute( value=Name(id='spam'), attr='eggs', uptalk=True), attr='cheese', uptalk=False))
Hm, I think the problem is that this way of representing the tree encourages thinking that each attribute (with or without ?) can be treated on its own.
It's hard to think of any other way of representing this in an AST that makes the short-circuiting behaviour any clearer. I suspect that displaying an AST isn't really going to be helpful as a way of documenting the semantics. Because the semantics aren't really in the AST itself, they're in the compiler code that interprets the AST. -- Greg