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
96b1c59c
Commit
96b1c59c
authored
Sep 19, 2019
by
t k
Committed by
Paul Ganssle
Sep 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-38155: Add __all__ to datetime module (GH-16203)
https://bugs.python.org/issue38155
parent
9fdc64cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
Lib/datetime.py
Lib/datetime.py
+4
-0
Lib/test/datetimetester.py
Lib/test/datetimetester.py
+6
-0
Misc/NEWS.d/next/Library/2019-09-16-21-47-48.bpo-38155.d92lRc.rst
...S.d/next/Library/2019-09-16-21-47-48.bpo-38155.d92lRc.rst
+1
-0
No files found.
Lib/datetime.py
View file @
96b1c59c
...
...
@@ -4,6 +4,10 @@ See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""
__all__
=
(
"date"
,
"datetime"
,
"time"
,
"timedelta"
,
"timezone"
,
"tzinfo"
,
"MINYEAR"
,
"MAXYEAR"
)
import
time
as
_time
import
math
as
_math
import
sys
...
...
Lib/test/datetimetester.py
View file @
96b1c59c
...
...
@@ -62,6 +62,12 @@ class TestModule(unittest.TestCase):
self
.
assertEqual
(
datetime
.
MINYEAR
,
1
)
self
.
assertEqual
(
datetime
.
MAXYEAR
,
9999
)
def
test_all
(
self
):
"""Test that __all__ only points to valid attributes."""
all_attrs
=
dir
(
datetime_module
)
for
attr
in
datetime_module
.
__all__
:
self
.
assertIn
(
attr
,
all_attrs
)
def
test_name_cleanup
(
self
):
if
'_Pure'
in
self
.
__class__
.
__name__
:
self
.
skipTest
(
'Only run for Fast C implementation'
)
...
...
Misc/NEWS.d/next/Library/2019-09-16-21-47-48.bpo-38155.d92lRc.rst
0 → 100644
View file @
96b1c59c
Add ``__all__`` to :mod:`datetime`. Patch by Tahia Khan.
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