diff options
-rw-r--r-- | giscanner/mallardwriter.py | 2 | ||||
-rw-r--r-- | tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py index ece54a9b..a4e9c073 100644 --- a/giscanner/mallardwriter.py +++ b/giscanner/mallardwriter.py @@ -404,7 +404,7 @@ class MallardFormatterPython(MallardFormatter): def format_parameter_name(self, node, parameter): # Force "self" for the first parameter of a method - if self.is_method(node) and parameter is node.parameters[0]: + if self.is_method(node) and parameter is node.instance_parameter: return "self" else: return parameter.argname diff --git a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page index 0b5681eb..390c40c2 100644 --- a/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page +++ b/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page @@ -52,7 +52,7 @@ def method(self, first_arg, second_arg, boolean_arg, pointer_arg, string): <p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj"/> that was created with <link xref="DocExamples.Obj.new"/>, by passing it -in as <code>obj</code>.</p><p>This should be a %FALSEALARM.</p> +in as <code>self</code>.</p><p>This should be a %FALSEALARM.</p> <p>Since 0.99</p> @@ -66,7 +66,7 @@ in as <code>obj</code>.</p><p>This should be a %FALSEALARM.</p> <dt><p>boolean_arg :</p></dt> <dd><p>You should always pass <code>True</code>.</p></dd> <dt><p>pointer_arg :</p></dt> -<dd><p>If not <code>None</code>, do a thing. Pass <code>self</code> if you want to sometimes. You can also pass <code>second_arg</code>, or even <code>boolean_arg</code>.</p></dd> +<dd><p>If not <code>None</code>, do a thing. Pass <code>first_arg</code> if you want to sometimes. You can also pass <code>second_arg</code>, or even <code>boolean_arg</code>.</p></dd> <dt><p>string :</p></dt> <dd><p>A NUL-terminated string.</p></dd> <dt><p>Returns :</p></dt> |