From: Vladimír Vondruš Date: Tue, 27 Aug 2019 18:47:01 +0000 (+0200) Subject: documentation/python: don't annotate free pybind function as staticmethods. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=f54376b9a1acdb2d0828dccb3abb28cd275280f8;p=blog.git documentation/python: don't annotate free pybind function as staticmethods. Wasn't visible in the output until now because we didn't have detailed docs for those. But now it will be. --- diff --git a/documentation/python.py b/documentation/python.py index 4a49bb0e..bf38994f 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -1052,10 +1052,13 @@ def extract_function_doc(state: State, parent, entry: Empty) -> List[Any]: # self being the name of first parameter :( No support for # classmethods, as C++11 doesn't have that out.is_classmethod = False - if inspect.isclass(parent) and args and args[0][0] == 'self': - out.is_staticmethod = False + if inspect.isclass(parent): + if args and args[0][0] == 'self': + out.is_staticmethod = False + else: + out.is_staticmethod = True else: - out.is_staticmethod = True + out.is_staticmethod = False # Guesstimate whether the arguments are positional-only or # position-or-keyword. It's either all or none. This is a brown