[issue5788] datetime.timedelta is inconvenient to use...

2011-10-21 Thread Brian Quinlan
Brian Quinlan added the comment: You'll probably get more traction if you file a new bug. -- ___ Python tracker ___ ___ Python-bugs-li

[issue5788] datetime.timedelta is inconvenient to use...

2011-10-21 Thread Mark Dickinson
Mark Dickinson added the comment: What about def total_minutes(td): return td / datetime.timedelta(minutes=1) ? -- ___ Python tracker ___ __

[issue5788] datetime.timedelta is inconvenient to use...

2011-10-19 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Sorry for commenting on a closed issue but I just bumped into a problem requiring a total_minute() method I ended up implementing by doing some raw math by hand. Would it be a reasonable addition? If so I'll open a separate issue. -- nosy: +giampao

[issue5788] datetime.timedelta is inconvenient to use...

2009-11-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: > A late note: this would be redundant if the oft-requested division of > timedeltas were implemented: t.total_seconds could then be spelt > > t/timedelta(seconds=1) It would be less obvious, though. -- ___ Pytho

[issue5788] datetime.timedelta is inconvenient to use...

2009-11-26 Thread Mark Dickinson
Mark Dickinson added the comment: That should be t.total_seconds(), of course. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5788] datetime.timedelta is inconvenient to use...

2009-11-26 Thread Mark Dickinson
Mark Dickinson added the comment: A late note: this would be redundant if the oft-requested division of timedeltas were implemented: t.total_seconds could then be spelt t/timedelta(seconds=1) with the advantage that there would then be a natural way to spell t.total_days or t.total_hours as

[issue5788] datetime.timedelta is inconvenient to use...

2009-11-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch is committed in r76529 (trunk) and r76530 (py3k). Thank you! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue5788] datetime.timedelta is inconvenient to use...

2009-05-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Given the timing, I fear this will have to wait for 3.2. -- versions: +Python 3.2 -Python 3.1 ___ Python tracker ___ ___

[issue5788] datetime.timedelta is inconvenient to use...

2009-05-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +mw44118 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-19 Thread Brian Quinlan
Brian Quinlan added the comment: Attached is a patch that implements .total_seconds as an instance method -- ___ Python tracker ___ __

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-19 Thread Brian Quinlan
Changes by Brian Quinlan : Added file: http://bugs.python.org/file13721/totalseconds2.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sorry for the last comment about unit tests, they are here actually :-) -- ___ Python tracker ___ __

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- priority: -> normal stage: -> patch review type: -> feature request ___ Python tracker ___ ___ Python

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: The addition looks quite legitimate to me. The only thing is that it may be better as a method (total_seconds()) rather than an attribute, given the other APIs in the datetime module. Also, the patch lacks some unit tests. -- nosy: +pitrou versions: +Py

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan
Brian Quinlan added the comment: OK, a bit on motivation: 1. datetime.timedelta instances are a convenient way of representing durations 2. datetime.timedelta instances cannot be conveniently used in many calculations e.g. calculating distance based on velocity and time 3. datetime.timedel

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Georg Brandl
Georg Brandl added the comment: I saw the patch description as well, but usually you put that description, and perhaps a motivation as well, in the comment. That way it's easier for people to directly see what an issue is about. -- ___ Python tracker

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan
Brian Quinlan added the comment: I did add a patch description: "Adds a datetime.total_seconds attribute" - is that unclear? The idea is that you should be able to extract the total number of seconds in the duration i.e. >>> dt = datetime.timedelta(seconds=1234567.89) >>> dt.total_seconds 12345

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Georg Brandl
Georg Brandl added the comment: Please include a proper description of your problem, and a patch description when you post a patch. -- nosy: +georg.brandl ___ Python tracker ___

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan
Changes by Brian Quinlan : -- keywords: +patch Added file: http://bugs.python.org/file13719/totalseconds.diff ___ Python tracker ___ __

[issue5788] datetime.timedelta is inconvenient to use...

2009-04-18 Thread Brian Quinlan
New submission from Brian Quinlan : ...in seconds-based library functions (e.g. time.sleep) and calculations (e.g. distance = velocity * ?). -- components: Library (Lib) messages: 86132 nosy: bquinlan severity: normal status: open title: datetime.timedelta is inconvenient to use... versi