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
4c11a926
Commit
4c11a926
authored
Feb 08, 2007
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1653736: Complain about keyword arguments to time.isoformat.
Will backport to 2.5.
parent
495df471
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
Lib/test/test_datetime.py
Lib/test/test_datetime.py
+5
-0
Misc/NEWS
Misc/NEWS
+2
-0
Modules/datetimemodule.c
Modules/datetimemodule.c
+2
-2
No files found.
Lib/test/test_datetime.py
View file @
4c11a926
...
...
@@ -1740,6 +1740,11 @@ class TestTime(HarmlessMixedComparison):
self
.
assertEqual
(
t
.
isoformat
(),
"00:00:00.100000"
)
self
.
assertEqual
(
t
.
isoformat
(),
str
(
t
))
def
test_1653736
(
self
):
# verify it doesn't accept extra keyword arguments
t
=
self
.
theclass
(
second
=
1
)
self
.
assertRaises
(
TypeError
,
t
.
isoformat
,
foo
=
3
)
def
test_strftime
(
self
):
t
=
self
.
theclass
(
1
,
2
,
3
,
4
)
self
.
assertEqual
(
t
.
strftime
(
'%H %M %S'
),
"01 02 03"
)
...
...
Misc/NEWS
View file @
4c11a926
...
...
@@ -347,6 +347,8 @@ Library
Extension Modules
-----------------
- Bug #1653736: Complain about keyword arguments to time.isoformat.
- Bug #1486663: don'
t
reject
keyword
arguments
for
subclasses
of
builtin
types
.
...
...
Modules/datetimemodule.c
View file @
4c11a926
...
...
@@ -3167,7 +3167,7 @@ time_str(PyDateTime_Time *self)
}
static
PyObject
*
time_isoformat
(
PyDateTime_Time
*
self
)
time_isoformat
(
PyDateTime_Time
*
self
,
PyObject
*
unused
)
{
char
buf
[
100
];
PyObject
*
result
;
...
...
@@ -3411,7 +3411,7 @@ time_reduce(PyDateTime_Time *self, PyObject *arg)
static
PyMethodDef
time_methods
[]
=
{
{
"isoformat"
,
(
PyCFunction
)
time_isoformat
,
METH_
KEYWORD
S
,
{
"isoformat"
,
(
PyCFunction
)
time_isoformat
,
METH_
NOARG
S
,
PyDoc_STR
(
"Return string in ISO 8601 format, HH:MM:SS[.mmmmmm]"
"[+HH:MM]."
)},
...
...
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