mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
gh-118404: Fix inspect.signature() for non-comparable callables (GH-118405)
This commit is contained in:
parent
5b05d452cd
commit
11f8348d78
3 changed files with 15 additions and 2 deletions
|
@ -2179,8 +2179,10 @@ def _signature_is_builtin(obj):
|
|||
ismethoddescriptor(obj) or
|
||||
isinstance(obj, _NonUserDefinedCallables) or
|
||||
# Can't test 'isinstance(type)' here, as it would
|
||||
# also be True for regular python classes
|
||||
obj in (type, object))
|
||||
# also be True for regular python classes.
|
||||
# Can't use the `in` operator here, as it would
|
||||
# invoke the custom __eq__ method.
|
||||
obj is type or obj is object)
|
||||
|
||||
|
||||
def _signature_is_functionlike(obj):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue