mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
gh-111999: Add signatures and improve docstrings for builtins (GH-112000)
This commit is contained in:
parent
d0058cbd1c
commit
1d75ef6b61
8 changed files with 74 additions and 39 deletions
|
|
@ -4734,12 +4734,13 @@ class TestSignatureDefinitions(unittest.TestCase):
|
|||
needs_null = {"anext"}
|
||||
no_signature |= needs_null
|
||||
# These need *args support in Argument Clinic
|
||||
needs_varargs = {"breakpoint", "min", "max", "__build_class__"}
|
||||
needs_varargs = {"min", "max", "__build_class__"}
|
||||
no_signature |= needs_varargs
|
||||
# These builtin types are expected to provide introspection info
|
||||
types_with_signatures = {
|
||||
'complex', 'enumerate', 'float', 'list', 'memoryview', 'object',
|
||||
'property', 'reversed', 'tuple',
|
||||
'bool', 'classmethod', 'complex', 'enumerate', 'filter', 'float',
|
||||
'frozenset', 'list', 'map', 'memoryview', 'object', 'property',
|
||||
'reversed', 'set', 'staticmethod', 'tuple', 'zip'
|
||||
}
|
||||
# Check the signatures we expect to be there
|
||||
ns = vars(builtins)
|
||||
|
|
@ -4753,6 +4754,10 @@ class TestSignatureDefinitions(unittest.TestCase):
|
|||
if (name in no_signature):
|
||||
# Not yet converted
|
||||
continue
|
||||
if name in {'classmethod', 'staticmethod'}:
|
||||
# Bug gh-112006: inspect.unwrap() does not work with types
|
||||
# with the __wrapped__ data descriptor.
|
||||
continue
|
||||
with self.subTest(builtin=name):
|
||||
self.assertIsNotNone(inspect.signature(obj))
|
||||
# Check callables that haven't been converted don't claim a signature
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue