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
c22eaecd
Commit
c22eaecd
authored
Jan 02, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.3 (closes #20108)
parents
393a9424
3e6ab171
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
Doc/library/inspect.rst
Doc/library/inspect.rst
+1
-1
Lib/inspect.py
Lib/inspect.py
+3
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Doc/library/inspect.rst
View file @
c22eaecd
...
...
@@ -753,7 +753,7 @@ Classes and functions
metatype is in use, cls will be the first element of the tuple.
.. function:: getcallargs(func
[, *args][, **kwds]
)
.. function:: getcallargs(func
, *args, **kwds
)
Bind the *args* and *kwds* to the argument names of the Python function or
method *func*, as if it was called with them. For bound methods, bind also the
...
...
Lib/inspect.py
View file @
c22eaecd
...
...
@@ -1087,12 +1087,14 @@ def _too_many(f_name, args, kwonly, varargs, defcount, given, values):
(
f_name
,
sig
,
"s"
if
plural
else
""
,
given
,
kwonly_sig
,
"was"
if
given
==
1
and
not
kwonly_given
else
"were"
))
def
getcallargs
(
func
,
*
positional
,
**
named
):
def
getcallargs
(
*
func_and_
positional
,
**
named
):
"""Get the mapping of arguments to values.
A dict is returned, with keys the function argument names (including the
names of the * and ** arguments, if any), and values the respective bound
values from 'positional' and 'named'."""
func
=
func_and_positional
[
0
]
positional
=
func_and_positional
[
1
:]
spec
=
getfullargspec
(
func
)
args
,
varargs
,
varkw
,
defaults
,
kwonlyargs
,
kwonlydefaults
,
ann
=
spec
f_name
=
func
.
__name__
...
...
Misc/NEWS
View file @
c22eaecd
...
...
@@ -46,6 +46,8 @@ Library
- Fix breakage in TestSuite.countTestCases() introduced by issue #11798.
- Issue #20108: Avoid parameter name clash in inspect.getcallargs().
- Issue #19918: Fix PurePath.relative_to() under Windows.
- Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl
...
...
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