Why do this?
ldo at geek-central.gen.new_zealand
Mon Oct 9 06:14:08 CEST 2006
In message <Xns98547173763B6duncanbooth at 127.0.0.1>, Duncan Booth wrote:
> Corrado Gioannini <gioco at nekhem.com> wrote:
>> I often do things like this:
>> sql = a_complex_select_sql % (id_foo, value_bar, ...)
>> inside the body of a function (or a class method), where
>> a_complex_select_sql is a string, containing several %s, %d ecc.,
>> that is defined globally (or somewhere else in the class).
> I hope you have a good reason why you don't do:
> cursor.execute(a_complex_select_sql, (id_foo, value_bar, ...))
I use the above when I can, when I can't I fall back on
More information about the Python-list