From 2dc859125883321fc4e73d6e581fad6fb960d25f Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 27 Jun 2020 02:25:50 -0400 Subject: [PATCH] Show classmethods separately in attribute table --- docs/extensions/attributetable.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/extensions/attributetable.py b/docs/extensions/attributetable.py index 75060866b..aa34ec95c 100644 --- a/docs/extensions/attributetable.py +++ b/docs/extensions/attributetable.py @@ -147,6 +147,7 @@ def get_class_results(lookup, modulename, name, fullname): groups = OrderedDict([ ('Attributes', []), ('Coroutines', []), + ('Classmethods', []), ('Methods', []), ('Decorators', []), ]) @@ -166,6 +167,8 @@ def get_class_results(lookup, modulename, name, fullname): doc = value.__doc__ or '' if inspect.iscoroutinefunction(value) or doc.startswith('|coro|'): key = 'Coroutines' + elif isinstance(value, classmethod): + key = 'Classmethods' elif inspect.isfunction(value): if doc.startswith(('A decorator', 'A shortcut decorator')): # finicky but surprisingly consistent