[DB-SIG] WHat's the status of DB modules and datetime.py support?

M.-A. Lemburg mal at egenix.com
Wed Dec 31 08:31:03 EST 2003


David Rushby wrote:
> --- Guido van Rossum wrote:
> 
>>>--- David Rushby wrote:
>>>Most of them (AFAIK) use mx.DateTime, which is recommended by the DB
>>>API standard as follows: "The preferred object types for the
> 
> date/time
> 
>>>objects are those defined in the mxDateTime package."
>>
>>That was written years before the 2.3 datetime type existed though.
>>I expect that if the standard were written today, for use with Python
>>2.3 or later, support of the standard datetime type would be required,
>>in addition to allowing optional support for a user-specified type
>>(the callback sketched earlier in this thread seems a fine
>>mechanism).
> 
> That sounds reasonable to me, but the DB API Spec 2 is *not* being
> written today; if Spec 2.1 suddenly mandates that dates and times be
> represented via the datetime module, thousands of client apps will be
> compatible with Spec 2.0 but not Spec 2.1.  A change of this magnitude
> seems more appropriate for Spec 3.0, just as you're holding off on
> backward-incompatible changes to Python until 3.0.

I don't think we need to break anything just to allow
datetime types being used in database modules. In fact,
the current DB API revision already allows their usage
(just as it allows strings to be used for date/time
representation or tuples of values).

> A scheme such as kinterbasdb 3.1's, in which the previous
> module-specific date/time representation remains the default
> (preserving backward-compatibility), but seamless stdlib datetime
> integration is available, seems more appropriate for a Spec 2.x point
> revision.

Since Python's type system is becoming more and more flexible,
and many database modules already provide one way or another
to set type mappings, perhaps we ought to start thinking
of a new standard mechanism to setup and define these
type mappings ?!

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Dec 31 2003)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the DB-SIG mailing list