Movatterモバイル変換
[0]ホーム
[Python-Dev] Comparing heterogeneous types
Aahzaahz at pythoncraft.com
Tue Jun 1 22:18:13 EDT 2004
On Mon, May 31, 2004, Robert Brewer wrote:>> Quite similar to my current "pet peeve":>> >>> None > 3> False> >>> None > 'hoopy'> False> >>> None > True> False> >>> None > datetime.date(2004, 5, 31)> Traceback (most recent call last):> File "<interactive input>", line 1, in ?> TypeError: can't compare datetime.date to NoneType>> ...writing an O-R mapper, this particular hobgoblin bites me rather often ;)Time for you to bite the bullet. Guido has all-but-decreed that thefuture of comparisons is that TypeError will be raised for all operatorsother than == and <> for types that have no appropriate relationshipsystem.-- Aahz (aahz at pythoncraft.com) <*>http://www.pythoncraft.com/"as long as we like the same operating system, things are cool." --piranha
More information about the Python-Devmailing list
[8]ページ先頭