Fixed mx.DateTime or alternative?

Steve Holden sholden at holdenweb.com
Tue Jul 3 10:09:36 EDT 2001


Until this is fixed (and the example you quote appears to be permissible
under 2.0, so I suppose it might be considered a buglet) you could get
around it by paraphrasing your test as

    if dt is None:

This removes any attempt to coerce, and so should be faster anyway.

regards
 Steve
--
http://www.holdenweb.com/


"Chuck Esterbrook" <ChuckEsterbrook at yahoo.com> wrote in message
news:mailman.994167665.8363.python-list at python.org...
> eGenix mx.DateTime 2.0.1 has a problem under Python 2.1. DateTime objects
> cannot be compared to None:
>
> C:>python
> Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32
> Type "copyright", "credits" or "license" for more information.
>  >>> from mx import DateTime
>  >>> dt = DateTime.now()
>  >>> if dt==None: print 1
> ...
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
> TypeError: can't coerce DateTime to the other type
>  >>>
>
>
> Does anyone have an eGenix build for Windows that is compatible with
Python
> 2.1?
>
> Reference:
>
http://www.lemburg.com/files/python/eGenix-mx-Extensions.html#Download-mxBAS
E
>
>
> -Chuck
>
>





More information about the Python-list mailing list