[issue41254] Add to/from string methods to datetime.timedelta

2021-07-30 Thread Matthew Kenigsberg
Matthew Kenigsberg added the comment: I think it would be nice to have a from str method that could reverse the behavior of str(timedelta). I'm trying to parse files that contain the output of str(timedelta), and there's no easy way to get them back to timedelta's -- nosy:

[issue41254] Add to/from string methods to datetime.timedelta

2020-07-20 Thread Paul Ganssle
Paul Ganssle added the comment: I think it is unlikely that we'll want to experiment with this directly in CPython. I don't think a fixed format (other than the annoying one that you already get from calling `str` on a timedelta) is appropriate, but designing a modular format for time

[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Miki Tebeka
Miki Tebeka added the comment: I think the lack sub second parts in these formats is a disadvantage. There's a merit in using a standard but IMO it's more natural to write someting like "2s" in a configuration value than "P2S" which is more cryptic. --

[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Martin Panter
Martin Panter added the comment: I don't know how much support this will get since there is already a str(timedelta) operation defined with a different format. But I don't like that format much. The day[s] part is too verbose, the H:MM:SS part could too easily be interpreted as D:HH:MM, and

[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +belopolsky, p-ganssle versions: +Python 3.10 ___ Python tracker ___ ___

[issue41254] Add to/from string methods to datetime.timedelta

2020-07-09 Thread Miki Tebeka
New submission from Miki Tebeka : I suggest adding datetime.timedelta methods that convert to/from str. The reason is that I have several places where configuration contains various timeouts. I'd like to write '50ms' and not 0.05 which is more human readable. See