Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(28)

#23521: OverflowError from timedelta * float in datetime.py

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 11 months ago by alexander.belopolsky
Modified:
4 years, 11 months ago
Reviewers:
storchaka
CC:
mark.dickinson, sasha, Benjamin Peterson, devnull_psf.upfronthosting.co.za, storchaka, bdkearns
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Patch Set 3 #

Patch Set 4 #

Total comments: 12

Patch Set 5 #

Total comments: 2

Patch Set 6 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/datetime.py View 1 2 3 4 5 3 chunks +23 lines, -3 lines 0 comments Download
Lib/test/datetimetester.py View 1 2 3 4 5 3 chunks +34 lines, -0 lines 0 comments Download

Messages

Total messages: 3
storchaka_gmail.com
https://bugs.python.org/review/23521/diff/14017/Lib/datetime.py File Lib/datetime.py (right): https://bugs.python.org/review/23521/diff/14017/Lib/datetime.py#newcode302 Lib/datetime.py:302: d, r = divmod(a, b) q, r for consistency ...
4 years, 11 months ago #1
sasha
https://bugs.python.org/review/23521/diff/14017/Lib/datetime.py File Lib/datetime.py (right): https://bugs.python.org/review/23521/diff/14017/Lib/datetime.py#newcode302 Lib/datetime.py:302: d, r = divmod(a, b) On 2015/02/26 08:19:36, storchaka ...
4 years, 11 months ago #2
storchaka_gmail.com
4 years, 11 months ago #3
http://bugs.python.org/review/23521/diff/14026/Lib/datetime.py
File Lib/datetime.py (right):

http://bugs.python.org/review/23521/diff/14026/Lib/datetime.py#newcode562
Lib/datetime.py:562: return timedelta(0, 0, _divide_and_round(usec, other))
I would make make special case for negative divisor here, not in
_divide_and_round(). In all other cases the divisor cannot be negative. Leave it
to your discretion.

http://bugs.python.org/review/23521/diff/14026/Lib/datetime.py#newcode564
Lib/datetime.py:564: a, b = other.as_integer_ratio()
Special case for infinity?
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+