Python Risk

Costas Menico costas at meezon.com
Fri May 11 07:01:52 EDT 2001


Bjorn Pettersen <BPettersen at NAREX.com> wrote:

>> From: m.hadfield at niwa.cri.nz [mailto:m.hadfield at niwa.cri.nz]
>> 
>> From: "Andrew Kuchling" <akuchlin at mems-exchange.org>
>> >
>> > * Strings may now be enclosed in double quotes as well as in single
>> > quotes.  There is no difference in interpretation.
>> >
>> > I mean, really, who ordered *that*?
>> 
>> I don't know, but it makes it easy to put either double 
>> quotes or single
>> quotes inside a string, thus:
>> 
>> " ' "   ' " '
>
>So you would want to add _all_ that syntax just to save a single '\'
>character in typing <wink>. I mean how often do you have quotes in your
>strings...
>

This dual quote syntax has saved my b many times. Visual Foxpro
actually allows "xx'xxx" or 'xxxx"xxxxx' or [zzzz"yyy'wwww]

When building expressions or taking user input sometimes you cannot
expect users not to enter a ' or " in the data. 

E.g.

select * from file where name="O'Brien"

costas



More information about the Python-list mailing list