chiark / gitweb /
documentation/python: don't annotate free pybind function as staticmethods.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 27 Aug 2019 18:47:01 +0000 (20:47 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 28 Aug 2019 14:36:13 +0000 (16:36 +0200)
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

index 4a49bb0e657770641746fc0e760af4150937b479..bf38994fd12a45242b6702b32b94c9d405291508 100755 (executable)
@@ -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