projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f40c663
)
inspect.Signature.bind: Add **kwargs/positional-only check back
author
Yury Selivanov
<yselivanov@sprymix.com>
Wed, 29 Jan 2014 01:54:28 +0000
(20:54 -0500)
committer
Yury Selivanov
<yselivanov@sprymix.com>
Wed, 29 Jan 2014 01:54:28 +0000
(20:54 -0500)
Lib/inspect.py
patch
|
blob
|
history
diff --git
a/Lib/inspect.py
b/Lib/inspect.py
index c3fecb8b8cb5bba3f703bba4d87792541d9421e4..00728206019834282700771fc3ebf7bba9c02504 100644
(file)
--- a/
Lib/inspect.py
+++ b/
Lib/inspect.py
@@
-2323,6
+2323,14
@@
class Signature:
format(arg=param_name)) from None
else:
+ if param.kind == _POSITIONAL_ONLY:
+ # This should never happen in case of a properly built
+ # Signature object (but let's have this check here
+ # to ensure correct behaviour just in case)
+ raise TypeError('{arg!r} parameter is positional only, '
+ 'but was passed as a keyword'. \
+ format(arg=param.name))
+
arguments[param_name] = arg_val
if kwargs: