From: Vladimír Vondruš Date: Tue, 27 Aug 2019 19:13:21 +0000 (+0200) Subject: documentation/python: special handling for self only if it's first. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=17e1ee791b35b0262a00a163000fbf7f26cf98d6;p=blog.git documentation/python: special handling for self only if it's first. I doubt anyone sane will name any other function parameters like that, but let's be sure. --- diff --git a/documentation/python.py b/documentation/python.py index bf38994f..7ddaec8e 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -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: