Alexander Belopolsky added the comment:
I left a few minor comments on rietveld for the last patch. I did not see code
for time.now() and I don't think adding now() should be combined with time +/-
timedelta patch. Let's do one thing at a time.
I think time + timedelta addition is fairly
Alexander Belopolsky added the comment:
This was proposed before and rejected in issue1118748, but I think current
proposal addresses the ambiguity that was sited as a reason for rejection.
--
nosy: +skip.montanaro
___
Python tracker
Alexander Belopolsky added the comment:
See also issue 3250. If we add mod 24h arithmetics, I would like to see
something like time.add_with_carry(timedelta) - (int, time) method. With it,
users who need a specific overflow behavior will be able to implement it easily:
def check_add(t, td):
Francisco Martín Brugué added the comment:
Hi Joar,
just a detail: is there a reason for the asymmetric check for timedelta
isinstance (and raising NotImplemented)? And BTW. isn't a double check for the
__sub__ case (or have I missed something)?
+def __add__(self, other):
+Add a
jbatista added the comment:
IMHO this should be safe when the timezone is UTC for example, where there is
no problems with daylight savings. What should be the behavior when adding a
certain timedelta() and it crosses a date where there is an hour switch due to
daylight savings? The unadvised
Ronald Oussoren added the comment:
datetime.time arithmetic cannot be timezone aware, as there is no associated
date and hence you cannot possibly know if there it a DST transition.
I don't think this is a problem. Adding/removing time to a clock value has
clear real-world semantics. Using
Petri Lehtinen added the comment:
A time object isn't associated with any date, so I don't really see a
problem here. The fact that you can shoot yourself in the leg can be
documented, noting that you should use datetime instead.
ISTM the reason why time objects even have an associated timezone
Joar Wandborg added the comment:
New patch, removed whitespace change and unnecessary test.
add_time_timedelta arg `factor` will not be changed, in order to preserve
uniformity.
--
Added file: http://bugs.python.org/file29251/issue17267-v3.patch
Petri Lehtinen added the comment:
LGTM.
--
stage: test needed - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17267
___
___
Changes by Ronald Oussoren ronaldousso...@mac.com:
--
keywords: +needs review
nosy: +belopolsky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17267
___
Joar Wandborg added the comment:
I am adding yet another patch. This time it has
- TZ-aware tests (datetimetester.TestTimeTZ).
- C time_subtract method.
- Pure time.__sub__ method.
in addition to the previous
- Tests for time + timedelta
- C time_add
- Pure time.__add__
There's one issue
Changes by Michele Orrù maker...@gmail.com:
--
nosy: +maker
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17267
___
___
Python-bugs-list mailing
Joar Wandborg added the comment:
Patch submitted, please review.
--
keywords: +patch
nosy: +joar
Added file: http://bugs.python.org/file29200/issue17267.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17267
Petri Lehtinen added the comment:
Added some comments to Rietveld.
--
nosy: +petri.lehtinen
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17267
___
Joar Wandborg added the comment:
New patch adressing the review comments.
--
Added file: http://bugs.python.org/file29205/issue17267.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17267
Andreas Åkerlund added the comment:
Well I have also made a patch for this, using the datetime operator code as
much as possible.. this is for version 3.4..
--
nosy: +thezulk
Added file: http://bugs.python.org/file29206/issue17267-3.4.diff
___
New submission from Ronald Oussoren:
It would be nice if datetime.time would be possible to add a delta to a
datetime.time object, and if datetime.time had a method for returning the
current time (just like datetime.date and date time.datetime have 'today' and
'now' methods).
Rationale for
Eric V. Smith added the comment:
What would this give:
tm = datetime.time(13, 20)
later = tm + datetime.timedelta(hours=47, minutes=44)
datetime.time(13, 4)? Or raise an exception?
I've thought about this before, but it's always a problem when going over date
boundaries. If you define
Ronald Oussoren added the comment:
IMHO this would to module 24 arithmetic, just like a normal clock.
When I do calculations with plain time that is what I want, if the date is also
important I use datetime.datetime. That a time value silently truncates when
going past midnight is IMHO also
19 matches
Mail list logo