[Python-ideas] Non-boolean return from __contains__
MRAB
python at mrabarnett.plus.com
Tue Jul 27 21:24:49 CEST 2010
Bruce Leban wrote:
> The idea of LINQ is that you write the expression directly in the
> language and it translates into a query expression. It's going to be
> operating on an expression parse tree, right? Rather than trying to
> change the allowable expressions maybe the question is to figure out how
> to translate what we have and find what we can't express with what we
> have (and that's an orthogonal question and has nothing to do with
> __xxx__ functions).
>
> On Tue, Jul 27, 2010 at 9:42 AM, Masklinn <masklinn at masklinn.net
> <mailto:masklinn at masklinn.net>> wrote:
>
> What about french quotes
>
> expr = «x + y * z»
>
>
> Isn't there are already a syntax for this?
>
> expr = lambda: x + y * z
>
> Maybe you want some conversion of that lambda into a different form:
>
> expr = @ast lambda: x + y + z
>
Or:
results = db => sql_expression
where the parse tree for "sql_expression" is passed to db.__linq__.
The parse tree is compiled to SQL and cached for possible future use.
More information about the Python-ideas
mailing list