Message297560
| Author |
vstinner |
| Recipients |
belopolsky, martin.panter, musically_ut, r.david.murray, serhiy.storchaka, tim.peters, vstinner |
| Date |
2017年07月03日.11:08:02 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1499080082.86.0.092109802948.issue30302@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> Furthermore, "seconds=28747" is not that user-friendly. A friendlier representation would be "hours=7, minutes=59, seconds=7" and similar information is displayed when you print a timedelta: (...)
I agree that seconds=28747 is not that user-friendly, *but* maybe it shows a flaw in timedelta design?
Maybe timedelta should only expose properties which would *compute* hours, minutes, etc. from an internal storage? But if we change timedelta.seconds value, it is likely to break the backward compatibility. I wrote my own total_seconds() function which uses days, seconds and microseconds fields.
Or maybe we need a new method to convert a timedelta into a more human friendly (named)tuple? |
|