[DB-SIG] pyformat Parameter Style

Federico Di Gregorio fog at initd.org
Wed May 14 15:53:04 EDT 2003

Il mer, 2003-05-14 alle 16:36, M.-A. Lemburg ha scritto:
> Chris Cogdon wrote:
> > The ONLY valid solution I see is to very specifically state that 
> > pyformat allows %s and %(keyname)s, and nothing else, which is what many 
> > API's already do; they don't specifically check for %non-s, but it 
> > doesn't work, because the parameters are already strings by the time it 
> > gets to the python % operator (see code snippets previous in this thread).
> I don't think the DB API should limit the authors in coming up
> with good uses of the various Python format codes. How they
> implement these is really up to the module author:
> %s could mean: "bind as string" while %i means: "bind as integer".
> %r could have the meaning: "bind as blob". You could even add new
> parameters for e.g. date, datetime and time. etc. etc.

i am not sure i like that. using different codes is perfectly good _as
long_ as the dbapi explains exactly what's the expected behaviour.

Federico Di Gregorio
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
                  Beh un bacio, se ben dato, non si rifiuta. --  <laura>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata
Url : http://mail.python.org/pipermail/db-sig/attachments/20030514/3b117dea/attachment.bin

More information about the DB-SIG mailing list