chiark / gitweb /
documentation/python: special handling for self only if it's first.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 27 Aug 2019 19:13:21 +0000 (21:13 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 28 Aug 2019 14:36:13 +0000 (16:36 +0200)
I doubt anyone sane will name any other function parameters like that, but
let's be sure.

documentation/python.py

index bf38994fd12a45242b6702b32b94c9d405291508..7ddaec8e10dad188c7e14d4c390a29a5d9071eb2 100755 (executable)
@@ -1095,7 +1095,7 @@ def extract_function_doc(state: State, parent, entry: Empty) -> List[Any]:
                 param = Empty()
                 param.name = name
                 # Don't include redundant type for the self argument
-                if name == 'self':
+                if i == 0 and name == 'self':
                     param.type = None
                     arg_types += [None]
                 else: