Message297029
I've added the following tests to remove the 0 attributes from the repr:
self.assertEqual(repr(self.theclass(days=1, seconds=0)),
"%s(days=1)" % name)
self.assertEqual(repr(self.theclass(seconds=60)),
"%s(seconds=60)" % name)
self.assertEqual(repr(self.theclass()),
"%s(seconds=0)" % name)
self.assertEqual(repr(self.theclass(microseconds=100)),
"%s(microseconds=100)" % name)
self.assertEqual(repr(self.theclass(days=1, microseconds=100)),
"%s(days=1, microseconds=100)" % name)
self.assertEqual(repr(self.theclass(seconds=1, microseconds=100)),
"%s(seconds=1, microseconds=100)" % name)
I am still ambivalent about factoring the minus sign outside, though.
I've also fixed a bug in test_datetime.py which prevented execution of the Python implementation in Lib/datetime.py.
TODO:
- Decide about factoring the minus sign.
- Drop description of timedelta.__repr__ from the documentation.
~
ut |
|
Date |
User |
Action |
Args |
2017-06-27 12:32:22 | musically_ut | set | recipients:
+ musically_ut, belopolsky, martin.panter, serhiy.storchaka |
2017-06-27 12:32:22 | musically_ut | set | messageid: <1498566742.09.0.366591585896.issue30302@psf.upfronthosting.co.za> |
2017-06-27 12:32:22 | musically_ut | link | issue30302 messages |
2017-06-27 12:32:21 | musically_ut | create | |
|