Fixed mx.DateTime or alternative?

M.-A. Lemburg mal at lemburg.com
Mon Jul 9 13:15:50 CEST 2001


Chuck Esterbrook wrote:
> 
> 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-mxBASE

I'll post a patch release later this week which addresses this problem;
was away for the Bordeaux Python Conference last week and way too busy 
to look into this.

Side note:

	if x is None: ...

is a possible workaround which is faster than using "==" !

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/




More information about the Python-list mailing list