[DB-SIG] API 3.0 limiting paramstyle to ['named', 'qmark'] is okay. ('format' is not desirable)
Michael Bayer
mike_mp at zzzcomputing.com
Fri May 17 18:39:54 CEST 2013
On May 17, 2013, at 11:50 AM, Daniele Varrazzo <daniele.varrazzo at gmail.com> wrote:
>
> If that's too provocative I think the Python dbapi should mandate the
> %s and %(name)s formats because they are the only ones to have well
> defined syntax and escaping rule and are well known to every python
> developer.
I forgot also, not to mention that Python itself is moving away from "%" as a formatting operator, in favor of the newer .format() method which has yet *another* syntax: see pep 3101:
http://www.python.org/dev/peps/pep-3101/
http://docs.python.org/3/library/string.html#formatspec
I love the format and pyformat styles a lot for Python programming but I feel like they cause a lot of confusion when they are additionally interpreted by a DBAPI. It runs you into various "double-escaping" types of situations.
More information about the DB-SIG
mailing list