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
afcee8b7
Commit
afcee8b7
authored
Mar 21, 2010
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
count keyword only arguments as part of the total
parent
f3b7a25a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
Lib/test/test_extcall.py
Lib/test/test_extcall.py
+6
-0
Python/ceval.c
Python/ceval.c
+2
-2
No files found.
Lib/test/test_extcall.py
View file @
afcee8b7
...
...
@@ -280,6 +280,12 @@ The number of arguments passed in includes keywords:
Traceback (most recent call last):
...
TypeError: f() takes exactly 1 argument (5 given)
>>> def f(a, *, kw):
... pass
>>> f(6, 4, kw=4)
Traceback (most recent call last):
...
TypeError: f() takes exactly 2 arguments (3 given)
"""
import
sys
...
...
Python/ceval.c
View file @
afcee8b7
...
...
@@ -3078,8 +3078,8 @@ PyEval_EvalCodeEx(PyCodeObject *co, PyObject *globals, PyObject *locals,
"argument%s (%d given)"
,
co
->
co_name
,
defcount
?
"at most"
:
"exactly"
,
co
->
co_argcount
,
co
->
co_argcount
==
1
?
""
:
"s"
,
total_args
,
total_args
==
1
?
""
:
"s"
,
argcount
+
kwcount
);
goto
fail
;
}
...
...
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