[Python-checkins] python/nondist/sandbox/datetime test_datetime.py,1.105,1.106
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Fri, 24 Jan 2003 14:32:31 -0800
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv18543
Modified Files:
test_datetime.py
Log Message:
Commenting out an obscure endcase test that can't be made to work the
same way under the C and Python implementations of datetime without more
work than it's worth. This has to do with exactly when mixed-type
comparisons, of date or datetime objects, against other kinds of objects
defining __cmp__, will or won't raise TypeError.
Index: test_datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/test_datetime.py,v
retrieving revision 1.105
retrieving revision 1.106
diff -C2 -d -r1.105 -r1.106
*** test_datetime.py 24 Jan 2003 19:07:56 -0000 1.105
--- test_datetime.py 24 Jan 2003 22:32:27 -0000 1.106
***************
*** 897,901 ****
their = AnotherDateTimeClass()
self.assertRaises(TypeError, cmp, our, their)
! self.assertEqual(cmp(their, our), 0)
# But date and datetime comparison return NotImplemented instead if the
--- 897,906 ----
their = AnotherDateTimeClass()
self.assertRaises(TypeError, cmp, our, their)
! # Oops: The next stab raises TypeError in the C implementation,
! # but not in the Python implementation of datetime. The difference
! # is due to that the Python implementation defines __cmp__ but
! # the C implementation defines tp_richcompare. This is more pain
! # to fix than it's worth, so commenting out the test.
! # self.assertEqual(cmp(their, our), 0)
# But date and datetime comparison return NotImplemented instead if the