summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 1f4216f..d46514f 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -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):