[DB-SIG] pyformat Parameter Style
Chris Cogdon
chris at cogdon.org
Wed May 14 09:30:39 EDT 2003
On Wednesday, May 14, 2003, at 07:36 US/Pacific, M.-A. Lemburg wrote:
> 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've no issue with APIs doing 'extra, non-standard' stuff as long as it
doesn't interfere with the existing specification. However, I *would*
like the specs clarified so that it stipulates that '%s' or
'%(keyname)s' is to be used for all data types.
--
("`-/")_.-'"``-._ Chris Cogdon <chris at cogdon.org>
. . `; -._ )-;-,_`)
(v_,)' _ )`-.\ ``-'
_.- _..-_/ / ((.'
((,.-' ((,/ fL
More information about the DB-SIG
mailing list