mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-32265: Classify class and static methods of builtin types. (#4776)
Add types.ClassMethodDescriptorType for unbound class methods.
This commit is contained in:
parent
2e3f570185
commit
3327a2ddf1
6 changed files with 32 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue