Fixed mx.DateTime or alternative?
mal at lemburg.com
Mon Jul 9 07:15:50 EDT 2001
Chuck Esterbrook wrote:
> eGenix mx.DateTime 2.0.1 has a problem under Python 2.1. DateTime objects
> cannot be compared to None:
> 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
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.
if x is None: ...
is a possible workaround which is faster than using "==" !
CEO eGenix.com Software GmbH
Consulting & Company: http://www.egenix.com/
Python Software: http://www.lemburg.com/python/
More information about the Python-list