summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-12-15 12:13:41 (GMT)
committerGitHub <noreply@github.com>2017-12-15 12:13:41 (GMT)
commit3327a2ddf1eaf8cc678f0219ba9edf7d632d1b20 (patch)
treed5913c7f893cc889b6a0b10142a66a01c709ac74 /Lib/inspect.py
parent2e3f5701858d1fc04caedefdd9a8ea43810270d2 (diff)
downloadcpython-3327a2ddf1eaf8cc678f0219ba9edf7d632d1b20.zip
cpython-3327a2ddf1eaf8cc678f0219ba9edf7d632d1b20.tar.gz
cpython-3327a2ddf1eaf8cc678f0219ba9edf7d632d1b20.tar.bz2
bpo-32265: Classify class and static methods of builtin types. (#4776)
Add types.ClassMethodDescriptorType for unbound class methods.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 8c121ce..b755187 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -457,10 +457,10 @@ def classify_class_attrs(cls):
continue
obj = get_obj if get_obj is not None else dict_obj
# Classify the object or its descriptor.
- if isinstance(dict_obj, staticmethod):
+ if isinstance(dict_obj, (staticmethod, types.BuiltinMethodType)):
kind = "static method"
obj = dict_obj
- elif isinstance(dict_obj, classmethod):
+ elif isinstance(dict_obj, (classmethod, types.ClassMethodDescriptorType)):
kind = "class method"
obj = dict_obj
elif isinstance(dict_obj, property):