[issue42817] timedelta zeropadding hh

2021-01-03 Thread Kevin Rasmussen
Kevin Rasmussen added the comment: Eric makes a pretty good point about how that ends up looking with days included and backward compatibility. Thanks everyone for humouring me and talking me through this one I'm going to close the issue as "not a bug". -- resolution: -> not a bug

[issue42817] timedelta zeropadding hh

2021-01-03 Thread Andrei Kulakov
Andrei Kulakov added the comment: In a date, hours are zero-padded probably because that's a common standard for military time dates. But there is no such standard for time periods, therefore timedelta don't have to match date display in respect to zero-padding, in my opinion. -- no

[issue42817] timedelta zeropadding hh

2021-01-03 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think zero padding makes sense. For example: >>> td = datetime.timedelta(hours=100) >>> str(td) '4 days, 4:00:00' I think '4 days, 04:00:00' would not be very user friendly. In any event, backward compatibility would prevent us from changing this. --

[issue42817] timedelta zeropadding hh

2021-01-03 Thread Kevin Rasmussen
Kevin Rasmussen added the comment: Question: Why should it be zeropadded to 2? Answer: Why wouldn't it be zeropadded to match the rest of the library? Honestly it just seemed like an inconsistency with the rest of the datetime module. It caught me off guard when I went I tried to pull __str

[issue42817] timedelta zeropadding hh

2021-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why should it be zeropadded to 2? It is likely this option was considered when that code was added, and rejected. -- nosy: +serhiy.storchaka ___ Python tracker __

[issue42817] timedelta zeropadding hh

2021-01-03 Thread Kevin Rasmussen
Kevin Rasmussen added the comment: Current behaviour: ``` # python Python 3.9.1 (default, Dec 18 2020, 05:16:04) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> td = datetime.timedelta(hours=3) >>> str(td) '3:00:00' >>> dt =

[issue42817] timedelta zeropadding hh

2021-01-03 Thread Kevin Rasmussen
Change by Kevin Rasmussen : -- keywords: +patch pull_requests: +22908 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24075 ___ Python tracker ___

[issue42817] timedelta zeropadding hh

2021-01-03 Thread Kevin Rasmussen
New submission from Kevin Rasmussen : It looks like hh should be zeropadded to 2 and isn't for timedelta. -- messages: 384273 nosy: krasmussen priority: normal severity: normal status: open title: timedelta zeropadding hh type: behavior versions: Python 3.10 ___