Santiago Gala <sg...@apache.org> added the comment:

I don't think they are equally clear, at least from the point of view of the 
code written towards the API. I think that

execute("UPDATE authors set name = ?, email = ?, comment = ? WHERE id = ?", 
(form.name, form.email, form.text, form.id))

is way less clear, more verbose, and prone to alignment errors, than

execute("UPDATE authors set name = :name, email = :email, comment = :text WHERE 
id = :id", form)

I think this is the reason why the PEP writer prefer named style and. I was 
about to recode an example using a dictionary for cleaner code, when I noticed 
the bug. Now I need to hardcode that sqlite3 supports 'named' style, even if 
paramstyle says other thing, or to dynamically test, in case they decide to 
remove support for the next release. Both are ugly alternatives.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8196>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to