STINNER Victor added the comment:

> 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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30302>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to