#74 pytimes should be the default

MySQLdb (285)

In 0.9.3b2 I notice you've added support for the new
builtin datetime module. In my opinion times.py should
import pytimes first, since it avoids reliance on the
third-party mx package.


  • Andy Dustman

    Andy Dustman - 2003-12-29

    Logged In: YES

    My logic for this was, since Python-2.3 has it's own
    datetime module, then if you've installed mx.DateTime, you
    probably prefer to use it over datetime.


  • Skip Montanaro

    Skip Montanaro - 2003-12-29

    Logged In: YES

    I might have mx installed for other reasons. For example, with
    Python 2.3 and mysql-python 0.9.2, mx.DateTime is still required
    if you want more exotic date/time objects. While it works to
    upgrade to 0.9.3 with that sort of setup, it's unclear unless you
    RTSL that MySQLdb will now support builtin datetime objects, and
    you have to twiddle the source to get at them.

    Seems like there's no clean way around it. Ask the user during

  • Andy Dustman

    Andy Dustman - 2003-12-30

    Logged In: YES

    I was thinking about that earlier tonight. Maybe. I'll think
    about it some more.

  • Michael C. Neel

    Michael C. Neel - 2004-03-25

    Logged In: YES

    Would it be possible (I don't see a reason why not) to allow
    the user to control this though cursor class, i.e. one class
    (or mixin for better control) uses mx, another datetime, and
    another dates are strings (which is needed because MySQL
    will accept a date of 2004-03-00 but this cannot be used as
    a datetime object because it's an invalid date).

    The default cursor should use datetime though, since it's
    not the python "way".

  • Andy Dustman

    Andy Dustman - 2004-05-18

    Logged In: YES

    The standard datetime module (what pytimes uses) will be the
    default and only time-handling module used in MySQLdb-1.1
    and newer. I will make an announcement about this shortly.


Log in to post a comment.