[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-25 Thread Elinaldo Monteiro
Elinaldo Monteiro added the comment: I am closed my issue. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-24 Thread hongweipeng
Change by hongweipeng : -- keywords: +patch pull_requests: +15167 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15481 ___ Python tracker ___

[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-22 Thread Michael Anckaert
Michael Anckaert added the comment: Thank you for the clarification Paul. It makes sense to me now to not include those accessors. On Thu, 22 Aug 2019 at 17:46, Paul Ganssle wrote: > > Paul Ganssle added the comment: > > > I would support this addition. The timedelta class already has

[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-22 Thread Paul Ganssle
Paul Ganssle added the comment: > I would support this addition. The timedelta class already has accessors for > days and seconds, why not for hours and minutes? The `timedelta.days` and `timedelta.seconds` accessors do not do what is being requested here. The component accessors just give

[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-22 Thread Michael Anckaert
Michael Anckaert added the comment: I would support this addition. The timedelta class already has accessors for days and seconds, why not for hours and minutes? The implementation should make use of the idiomatic way as Serhiy mentioned. >>> timedelta(hours=25).seconds // 3600 1 Is

[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-22 Thread Elinaldo Monteiro
Elinaldo Monteiro added the comment: Imagine the following scenario. from datetime import timedelta diff = timedelta(hours=23, minutes=59) - timedelta(hours=20, minutes=45) Which is the simplest ? diff.hours diff.total_seconds() // 3600 -- ___

[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was already proposed several times before. The problem is that what do you expect to get from timedelta(hours=24).hours? The idiomatic way to convert a timedelta object to a number of hours is: td = timedelta(...) number_of_hours = td //

[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +belopolsky, p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-22 Thread Elinaldo Monteiro
New submission from Elinaldo Monteiro : Hello, Does it make sense to exist theses 2 methods in class timedelta? @property def hours(self): return self._seconds // 3600 @property def minutes(self): return self._seconds // 60 -- messages: 350182 nosy: elinaldosoft priority: