Message294062
| Author |
martin.panter |
| Recipients |
belopolsky, martin.panter, musically_ut, serhiy.storchaka |
| Date |
2017年05月21日.00:20:24 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1495326025.85.0.714312567977.issue30302@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I think the benefit of the repr being easier to understand outweighs the pain of breaking the old format. If the change is a problem, that might be mitigated by adding an entry to the "Porting to Python 3.7" documentation.
I don’t think my option of factoring the minus sign out to the front of the timedelta constructor was mentioned on Python-dev. The advantage is that it doesn’t mention problematic negative attribute values, and if you negate a timedelta, you still get the right attribute values:
>>> d
-datetime.timedelta(seconds=60)
>>> -d
datetime.timedelta(seconds=60)
>>> (-d).seconds
60 |
|