Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b1c8ec01
Commit
b1c8ec01
authored
Aug 04, 2019
by
Raymond Hettinger
Committed by
GitHub
Aug 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-28292: Mark calendar.py helper functions as private. (GH-15113)
parent
8183bb81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
Lib/calendar.py
Lib/calendar.py
+6
-6
Misc/NEWS.d/next/Library/2019-08-04-11-47-58.bpo-28292.vkihH5.rst
...S.d/next/Library/2019-08-04-11-47-58.bpo-28292.vkihH5.rst
+3
-0
No files found.
Lib/calendar.py
View file @
b1c8ec01
...
...
@@ -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
...
...
Misc/NEWS.d/next/Library/2019-08-04-11-47-58.bpo-28292.vkihH5.rst
0 → 100644
View file @
b1c8ec01
Mark calendar.py helper functions as being private. The follows PEP 8
guidance to maintain the style conventions in the module and it addresses a
known case of user confusion.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment