Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e939f38

Browse files
committed
Fix documentation for inspect module to pass doctest
1 parent efcaba0 commit e939f38

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Doc/library/inspect.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,14 @@ Classes and functions
494494
>>> from inspect import getcallargs
495495
>>> def f(a, b=1, *pos, **named):
496496
... pass
497-
>>> getcallargs(f, 1, 2, 3)
498-
{'a': 1, 'named': {}, 'b': 2, 'pos': (3,)}
499-
>>> getcallargs(f, a=2, x=4)
500-
{'a': 2, 'named': {'x': 4}, 'b': 1, 'pos': ()}
497+
>>> getcallargs(f, 1, 2, 3) == {'a': 1, 'named': {}, 'b': 2, 'pos': (3,)}
498+
True
499+
>>> getcallargs(f, a=2, x=4) == {'a': 2, 'named': {'x': 4}, 'b': 1, 'pos': ()}
500+
True
501501
>>> getcallargs(f)
502502
Traceback (most recent call last):
503503
...
504-
TypeError: f() takes at least 1 argument (0 given)
504+
TypeError: f() missing 1 required positional argument: 'a'
505505

506506
.. versionadded:: 3.2
507507

0 commit comments

Comments
 (0)