summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--giscanner/mallard-Python-function.tmpl3
-rw-r--r--tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page2
2 files changed, 4 insertions, 1 deletions
diff --git a/giscanner/mallard-Python-function.tmpl b/giscanner/mallard-Python-function.tmpl
index 9ccc723c..03a3e394 100644
--- a/giscanner/mallard-Python-function.tmpl
+++ b/giscanner/mallard-Python-function.tmpl
@@ -56,6 +56,9 @@ ${formatter.format_type(arg.type) | x}\
@returns(${formatter.format_type(node.retval.type) | x})
def \
${node.name}(\
+% if node.is_method:
+self, \
+% endif
% for arg, ix in zip(node.parameters, range(len(node.parameters))):
${arg.argname}\
% if ix != len(node.parameters) - 1:
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 3a20d14c..8447be6b 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
@@ -43,7 +43,7 @@
<synopsis><code mime="text/x-python">
@accepts(gint, gfloat, gboolean, gpointer, utf8)
@returns(gboolean)
-def method(first_arg, second_arg, boolean_arg, pointer_arg, string):
+def method(self, first_arg, second_arg, boolean_arg, pointer_arg, string):
# Python wrapper for doc_examples_obj_method()
</code></synopsis>
<p>This is an example of how to document a method.</p><p>You should call this on a <link xref="DocExamples.Obj">DocExamples.Obj</link> that was