Skip to content
Snippets Groups Projects
Commit 50381917 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Fix (static) labels in docs

parent c84d9c1d
Branches
Tags
No related merge requests found
...@@ -256,7 +256,7 @@ def autodoc_process_signature(app, what, name, obj, options, signature, ...@@ -256,7 +256,7 @@ def autodoc_process_signature(app, what, name, obj, options, signature,
def autodoc_process_docstring(app, what, name, obj, options, lines): def autodoc_process_docstring(app, what, name, obj, options, lines):
from inspect import isclass, isroutine, ismethod from inspect import isclass, isroutine
UNDERSCORE_WHITELIST = ["__len__", "__hash__", "__eq__", "__ne__"] UNDERSCORE_WHITELIST = ["__len__", "__hash__", "__eq__", "__ne__"]
if isclass(obj) and obj.__name__[0].isupper(): if isclass(obj) and obj.__name__[0].isupper():
methods = [nm for nm in dir(obj) methods = [nm for nm in dir(obj)
...@@ -265,7 +265,7 @@ def autodoc_process_docstring(app, what, name, obj, options, lines): ...@@ -265,7 +265,7 @@ def autodoc_process_docstring(app, what, name, obj, options, lines):
def gen_method_string(meth): def gen_method_string(meth):
result = ":meth:`%s`" % meth result = ":meth:`%s`" % meth
if not ismethod(getattr(obj, meth)): if getattr(obj, "_" + meth + "_is_static", False):
result += " (static)" result += " (static)"
return result return result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment