Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-111999: Add signatures and improve docstrings for builtins #112000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update tests.
  • Loading branch information
serhiy-storchaka committed Nov 12, 2023
commit 3a85902d4003978537e4b61ddfec30e169348042
11 changes: 8 additions & 3 deletions 11 Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -4734,12 +4734,13 @@ def test_builtins_have_signatures(self):
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)
Expand All @@ -4753,6 +4754,10 @@ def test_builtins_have_signatures(self):
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
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.