inspect: Fix getfullargspec to support builtin module-level functions. Issue #20711

This commit is contained in:
Yury Selivanov 2014-02-21 01:32:42 -05:00
parent b226026299
commit 8c185ee12e
2 changed files with 16 additions and 2 deletions

View file

@ -643,6 +643,13 @@ class TestClassesAndFunctions(unittest.TestCase):
self.assertFullArgSpecEquals(_pickle.Pickler(io.BytesIO()).dump,
args_e=['self', 'obj'], formatted='(self, obj)')
self.assertFullArgSpecEquals(
os.stat,
args_e=['path'],
kwonlyargs_e=['dir_fd', 'follow_symlinks'],
kwonlydefaults_e={'dir_fd': None, 'follow_symlinks': True},
formatted='(path, *, dir_fd=None, follow_symlinks=True)')
@cpython_only
@unittest.skipIf(MISSING_C_DOCSTRINGS,
"Signature information for builtins requires docstrings")