Collin Winter schrieb:
> What's inconsistent about it? That classes are being used for the
> _ast.{Add,Sub,Mult,etc} names?

Exactly. These aren't names - they are nodes in the tree. All nodes
are instances of _ast.AST.

> I don't see the need for both _ast.Add and _ast.Add.singleton or
> _ast.add or however else it might be spelled. I'd be perfectly happy
> doing something like "_ast.Add = object()" (when initializing the _ast
> module), so long as I can write "node.op is _ast.Add", "node.op ==
> _ast.Add", or something equally brief and to-the-point.

Would you like to do the same for Pass, Break, Continue, and Ellipsis?

They are also "just names". If you make _ast.Add the entry in the
tree itself, why not _ast.Break? Or, if you have a way to deal with
_ast.Break, why can't the same way work for _ast.Add?

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to