In message <mailman.2416.1257062070.2807.python-l...@python.org>, Dennis Lee 
Bieber wrote:

> On Sun, 01 Nov 2009 19:08 +1300, Lawrence D'Oliveiro
> <l...@geek-central.gen.new_zealand> declaimed the following in
> gmane.comp.python.general:
> 
>> On the grounds that Python has more general and powerful string
>> parameter- substitution mechanisms than anything built into any database
>> API.
> 
> Really? In the case of MySQLdb, the DB-API /uses/ Pythons string
> interpolation ...

Only a limited subset thereof. For instance, I'm not aware of any database
API that lets me do this:

   sql.cursor.execute \
      (
            "update numbers set flags = flags | %(setflags)u where projectid = 
%(projectid)s"
            "%(match_listid)s and number = %(number)s"
        %
            {
                "projectid" : SQLString(ProjectID),
                "match_listid" :
                    ("", " and listid = %s" % SQLString(ListID))[ListID != 
None],
                "number" : SQLString(number),
                "setflags" : flags,
            }
      )

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to