List/Tuple bug or feature?
sismex01 at hebmex.com
sismex01 at hebmex.com
Wed Sep 25 19:18:28 EDT 2002
>
> sismex01 at hebmex.com fed this fish to the penguins on Tuesday 24
> September 2002 03:12 pm:
>
> > It's one of python's features :-)
> >
> > For when you wanna write a long string, SQL for example:
> >
> > Query = "SELECT what, when, where, why "
> > "FROM t1, t2, t2 "
> > "WHERE t1.id = t2.id_t1 and t3.id_t2 = t2.id and t1.id_t2 =
> > t3.id " "AND t1.answer = 'OK'"
> >
> What's wrong with...
>
> query = """select what, when, where, why
> from t1, t2, t3
> where t1.id = t2.id_t1
> and t3_id2 = t2.id ...etc """
>
Hey, don't kill the messenger, I'm just explaining what
happened regarding the auto-concatenation of string
constants. If you don't like, don't use it.
But then, you did ask.
>>> query = """select what, when, where, why
from t1, t2, t3
where t1.id = t2.id_t1
and t3_id2 = t2.id ...etc """
>>> query
'select what, when, where, why\n from t1, t2, t3\n
where t1.id = t2.id_t1\n and t3_id2 = t2.id ...etc '
>>>
...an unsightly amount of useless whitespace.
-gus
Advertencia:
La informacion contenida en este mensaje es confidencial y restringida y
esta destinada unicamente para el uso de la persona arriba indicada, Esta
comunicacion representa la opinion personal del remitente y no refleja
necesariamente la opinion de la Compañia. Se le notifica que esta
estrictamente prohibida cualquier difusion, distribucion o copia de este
mensaje. Si ha recibido esta comunicacion o copia de este mensaje por error,
o si hay problemas en la transmision, favor de comunicarse con el remitente.
Todo el correo electrónico enviado para o desde esta dirección será
procesado por el sistema de correo corporativo de HEB. Tal correo
electrónico esta sujeto a ser almacenado y puede ser revisado por alguien
ajeno al recipiente autorizado con el propósito de monitorear que se cumplan
las normas de seguridad de la empresa.
More information about the Python-list
mailing list