Issue 9430: Document str() and repr() of timedelta. (original) (raw)

Issue9430

Created on 2010-07-30 18:57 by belopolsky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
datetime.rst.diff belopolsky,2010-07-30 18:57
issue9430.diff belopolsky,2010-07-31 00:37
Messages (6)
msg112096 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-30 18:57
Attaching a tentative patch. I think it is better to document these as operations rather than special methods. It may need to be clarified that "-2 days, 0:00:22" is timedelta(-2, 22) rather than -timedelta(2, 22), but I cannot come up with anything short enough for the ops table. Maybe this should be done in a footnote.
msg112097 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-07-30 19:18
Adding a footnote with an example sounds like a good idea. There's an odd number of square brackets in the str(t) description.
msg112110 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-31 00:37
First revision: .diff
msg112133 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2010-07-31 11:25
I think it would be clearer if the footnote said something like "Negative 1 day plus 19 hours is equivalent to the timedelta argument of -5 hours)". If I hadn't been following the discussion on #python-dev the point of this doc change would have been lost on me without much closer scrutiny, so a little more explanation would help.
msg112138 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-07-31 11:36
Looks good to me.
msg112141 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-31 11:40
Committed in r83341.
History
Date User Action Args
2022-04-11 14:57:04 admin set github: 53676
2010-07-31 11:40:21 georg.brandl set status: open -> closednosy: + georg.brandlmessages: + resolution: fixed
2010-07-31 11:36:56 pitrou set messages: +
2010-07-31 11:25:54 eric.smith set nosy: + eric.smithmessages: +
2010-07-31 00:37:14 belopolsky set files: + issue9430.diffmessages: +
2010-07-30 19🔞46 ezio.melotti set nosy: + ezio.melottimessages: + stage: patch review
2010-07-30 19:00:07 belopolsky set nosy: + pitrou
2010-07-30 18:57:54 belopolsky create