mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-14 09:50:03 +00:00
Show classmethods separately in attribute table
This commit is contained in:
parent
6351ef344b
commit
2dc8591258
@ -147,6 +147,7 @@ def get_class_results(lookup, modulename, name, fullname):
|
|||||||
groups = OrderedDict([
|
groups = OrderedDict([
|
||||||
('Attributes', []),
|
('Attributes', []),
|
||||||
('Coroutines', []),
|
('Coroutines', []),
|
||||||
|
('Classmethods', []),
|
||||||
('Methods', []),
|
('Methods', []),
|
||||||
('Decorators', []),
|
('Decorators', []),
|
||||||
])
|
])
|
||||||
@ -166,6 +167,8 @@ def get_class_results(lookup, modulename, name, fullname):
|
|||||||
doc = value.__doc__ or ''
|
doc = value.__doc__ or ''
|
||||||
if inspect.iscoroutinefunction(value) or doc.startswith('|coro|'):
|
if inspect.iscoroutinefunction(value) or doc.startswith('|coro|'):
|
||||||
key = 'Coroutines'
|
key = 'Coroutines'
|
||||||
|
elif isinstance(value, classmethod):
|
||||||
|
key = 'Classmethods'
|
||||||
elif inspect.isfunction(value):
|
elif inspect.isfunction(value):
|
||||||
if doc.startswith(('A decorator', 'A shortcut decorator')):
|
if doc.startswith(('A decorator', 'A shortcut decorator')):
|
||||||
# finicky but surprisingly consistent
|
# finicky but surprisingly consistent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user