]> granicus.if.org Git - python/commitdiff
Fix documentation for inspect module to pass doctest
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Thu, 9 Aug 2012 10:25:32 +0000 (13:25 +0300)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Thu, 9 Aug 2012 10:25:32 +0000 (13:25 +0300)
Doc/library/inspect.rst

index ac0d6e655526c7e75a249f3295e1955b7521205c..3ec17d6a0ce9eeba860f2cb21b57d71a7e61fa50 100644 (file)
@@ -494,14 +494,14 @@ Classes and functions
     >>> 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