[PEAK] bulletins example OF DOOM

Phillip J. Eby pje at telecommunity.com
Mon Apr 12 15:32:38 EDT 2004


At 03:22 PM 4/12/04 -0400, Stephen C. Waterbury wrote:
>Phillip J. Eby wrote:
>
>>'Date' is not a DBAPI type constant.
>
>Not in DBAPI 1.0, but DBAPI 1.0 has been "replaced", and 'DATE'
>is no longer specified as a type constant -- 'DATE' does not occur
>in the DBAPI 2.0 specification (PEP 249, which _replaces_ PEP 248).

That's 'DATE', not 'Date'.  'Date' is *not* a PEP 248 DBAPI constant; it's 
a PEP 249 DBAPI *constructor*.

'supportedTypes' is a list of type constant names, *not* constructor names, 
so you *may* include 'DATE' if the driver supports it, but you must *not* 
include 'Date' because it is not the right kind of thing to be in that list 
at all.  If your driver does not support 'DATE', do not try to substitute 
'Date': it is entirely unrelated.


>'DATE' does occur in PEP 248, but if conventions that are part of
>PEP 248 are supposed to be maintained in PEP 249, they should be
>included in PEP 249 (otherwise, PEP 249 should not say "replaces
>PEP 248"; "extends" maybe, but I would not advocate that approach
>either, as it gets too confusing).
>
>Since both psycopg and pyPgSQL claim to be DBAPI 2.0-compliant,
>they should treat such type constant names as case-independent,

No.  Date and DATE are two entirely different things that *cannot* be 
mixed.  Please drop that thought right now.

Type constants are only required to be comparable; constructors must be 
callable.  No sane DBAPI driver has any kind of crossover between the two.




More information about the PEAK mailing list