[PEAK] bulletins example OF DOOM

Stephen C. Waterbury golux at comcast.net
Mon Apr 12 15:55:36 EDT 2004

Phillip J. Eby wrote:
> 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*.

I know that.  I did not say that 'Date' is a PEP 248 DBAPI constant;
I merely said that "DATE" is specified in PEP 248.  Yes, I know the
difference between constants and constructors.  :)

> '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.

In a PEAK context, type constants and constructors should be
distinguishable even if they have the same name, since they
have quite different roles in the meta-model.

>> 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.

It never crossed my mind.  ;)  However, the things should not be
confused with their names.  'Date' and 'DATE' are not entirely
different things; they are strings.

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

We are in violent agreement on that!


More information about the PEAK mailing list