summaryrefslogtreecommitdiffstats
path: root/Doc/library/inspect.rst
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-12-05 03:48:47 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-12-05 03:48:47 (GMT)
commited648a35ec59f4f44f6758270b45dc0c238adb18 (patch)
treed0fc4bf9a7419dd9c2387c4662ce5bfda9d7e10f /Doc/library/inspect.rst
parent96a4b5adfcfaf1e7c9f854929e12737703aaf54f (diff)
downloadcpython-ed648a35ec59f4f44f6758270b45dc0c238adb18.zip
cpython-ed648a35ec59f4f44f6758270b45dc0c238adb18.tar.gz
cpython-ed648a35ec59f4f44f6758270b45dc0c238adb18.tar.bz2
docs.inspect: Fix BoundArguments example. Issue #22998.
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r--Doc/library/inspect.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 3ac66d8..3d2132f 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -678,7 +678,8 @@ function.
((5,), {})
>>> for param in sig.parameters.values():
- ... if param.name not in ba.arguments:
+ ... if (param.name not in ba.arguments
+ ... and param.default is not param.empty):
... ba.arguments[param.name] = param.default
>>> ba.args, ba.kwargs