[Python-checkins] cpython: Fix documentation for inspect module to pass doctest

andrew.svetlov python-checkins at python.org
Thu Aug 9 12:25:50 CEST 2012


http://hg.python.org/cpython/rev/4ba3e3b822d1
changeset:   78474:4ba3e3b822d1
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Thu Aug 09 13:25:32 2012 +0300
summary:
  Fix documentation for inspect module to pass doctest

files:
  Doc/library/inspect.rst |  10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)


diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -494,14 +494,14 @@
     >>> from inspect import getcallargs
     >>> def f(a, b=1, *pos, **named):
     ...     pass
-    >>> getcallargs(f, 1, 2, 3)
-    {'a': 1, 'named': {}, 'b': 2, 'pos': (3,)}
-    >>> getcallargs(f, a=2, x=4)
-    {'a': 2, 'named': {'x': 4}, 'b': 1, 'pos': ()}
+    >>> getcallargs(f, 1, 2, 3) == {'a': 1, 'named': {}, 'b': 2, 'pos': (3,)}
+    True
+    >>> getcallargs(f, a=2, x=4) == {'a': 2, 'named': {'x': 4}, 'b': 1, 'pos': ()}
+    True
     >>> getcallargs(f)
     Traceback (most recent call last):
     ...
-    TypeError: f() takes at least 1 argument (0 given)
+    TypeError: f() missing 1 required positional argument: 'a'
 
    .. versionadded:: 3.2
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list