From f54376b9a1acdb2d0828dccb3abb28cd275280f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 27 Aug 2019 20:47:01 +0200 Subject: [PATCH] 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. --- documentation/python.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 -- 2.30.2