[Python-Dev] ANN: PEP 335: Overloadable Boolean Operators

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Sep 14 04:58:22 CEST 2004

> IMO, the algebraic/query use cases would be better served by some
> sort of "code literal" or "AST literal" syntax

You may be right about the symbolic algebra case, if the intent is to
be able to write code that manipulates expressions, in which case
writing the expressions to be manipulated as literals of some kind may
make sense.

But I don't agree in the SQL case, where my intent is for the user to
simply write Python code that performs database queries, not write
Python code that constructs trees of SQL expressions that perform
database queries. The fact that expression manipulation is going on
should be an implementation detail that the user doesn't need to be
aware of. Having to write the query expressions using some special
syntax would interfere with that.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+

More information about the Python-Dev mailing list