summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2019-08-04 20:14:03 (GMT)
committerGitHub <noreply@github.com>2019-08-04 20:14:03 (GMT)
commitb1c8ec010fb4eb2654ca994e95144c8f2fea07fb (patch)
treeffb5511d12281b940804a3f32787ee593a78f892 /Lib
parent8183bb8150edcac6a7525bfb7708d08837ecb095 (diff)
downloadcpython-b1c8ec010fb4eb2654ca994e95144c8f2fea07fb.zip
cpython-b1c8ec010fb4eb2654ca994e95144c8f2fea07fb.tar.gz
cpython-b1c8ec010fb4eb2654ca994e95144c8f2fea07fb.tar.bz2
bpo-28292: Mark calendar.py helper functions as private. (GH-15113)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/calendar.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/calendar.py b/Lib/calendar.py
index 3828c43..7550d52 100644
--- a/Lib/calendar.py
+++ b/Lib/calendar.py
@@ -127,18 +127,18 @@ def monthrange(year, month):
return day1, ndays
-def monthlen(year, month):
+def _monthlen(year, month):
return mdays[month] + (month == February and isleap(year))
-def prevmonth(year, month):
+def _prevmonth(year, month):
if month == 1:
return year-1, 12
else:
return year, month-1
-def nextmonth(year, month):
+def _nextmonth(year, month):
if month == 12:
return year+1, 1
else:
@@ -207,13 +207,13 @@ class Calendar(object):
day1, ndays = monthrange(year, month)
days_before = (day1 - self.firstweekday) % 7
days_after = (self.firstweekday - day1 - ndays) % 7
- y, m = prevmonth(year, month)
- end = monthlen(y, m) + 1
+ y, m = _prevmonth(year, month)
+ end = _monthlen(y, m) + 1
for d in range(end-days_before, end):
yield y, m, d
for d in range(1, ndays + 1):
yield year, month, d
- y, m = nextmonth(year, month)
+ y, m = _nextmonth(year, month)
for d in range(1, days_after + 1):
yield y, m, d