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

Issue 25079: datetime.MonthDelta

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 1 month ago by Jess Austin
Modified:
5 months, 2 weeks ago
Reviewers:
Visibility:
Public.

Description

This is Issue #5434, http://bugs.python.org/issue5434, on the python tracker. This patch adds a monthdelta class to the datetime module, which represents date offsets in terms of months. It supports basic integer-like arithmetic, and also it may be added to dates and datetimes. It deals sensibly with leap-year and month-length issues. Also provided is a function, monthmod (named by imperfect analogy to divmod), which allows round-tripping: that is, taking 2 dates and returning a (monthdelta, timedelta) tuple that represents the interim between the dates. Note: The "monthdelta" class will retain its lowercased name; see discussion at rejected Issue 5530.

Patch Set 1 #

Patch Set 2 : cleaned up monthmod a bit #

Patch Set 3 : small doc and test changes #

Patch Set 4 : more doc and test updates #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1185 lines, -2 lines) Patch
M Doc/c-api/datetime.rst View 1 2 3 chunks +31 lines, -0 lines 0 comments Download
M Doc/library/datetime.rst View 1 2 3 10 chunks +287 lines, -1 line 0 comments Download
M Include/datetime.h View 1 2 7 chunks +25 lines, -0 lines 0 comments Download
M Lib/test/test_datetime.py View 1 2 3 2 chunks +216 lines, -0 lines 0 comments Download
M Misc/NEWS View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M Modules/datetimemodule.c View 1 2 20 chunks +623 lines, -1 line 0 comments Download

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b