[PyGreSQL] Do we need mx.DateTime?

Christoph Zwerschke cito at online.de
Wed Nov 19 12:08:16 EST 2008


D'Arcy J.M. Cain schrieb:
> I am wondering about this code.
> 
> try: # use mx.DateTime module if available
>     from mx.DateTime import DateTime, \
>         TimeDelta, DateTimeType
> except ImportError: # otherwise use standard datetime module
>     from datetime import datetime as DateTime, \
>         timedelta as TimeDelta, datetime as DateTimeType
> 
> Does mx.DateTime give us anything that the standard module doesn't?  If
> not I would like to get rid of it rather than depending on a third
> party package to build ours.

I think mx.DateTime has some more features, but the main reason was that
old Python versions simply did not have the datetime module and that we
wanted to keep a compatible datetime format if possible. But since we
decided to require Py 2.3 in the next version anyway, I agree it's best
to get rid of that. Importing the other way round then wouldn't make
sense either, since Py >= 2.3 always has datetime.

-- Christoph


More information about the PyGreSQL mailing list