From 10ca0edddb77e1a1a78e073b636af8d1f89eac41 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 15 May 2023 11:09:13 +1200 Subject: Add %rename to %pythoncode example Without this you get two set_transform() functions defined in the .py file, which can trigger warnings from linting tools. Renaming the SWIG-generated wrapper is a reasonably clean solution (though does leave an unused _set_transform() Python function). See #2578 --- Doc/Manual/Python.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index 74f5167ea..a5175daf3 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -3425,9 +3425,15 @@ For example:
+/* Rename the SWIG-generated wrapper. */
+%rename _set_transform set_transform;
+
+...
+
 void set_transform(Image *im, double x[4][4]);
 
 ...
+
 /* Rewrite the high level interface to set_transform */
 %pythoncode %{
 def set_transform(im, x):
@@ -3435,7 +3441,7 @@ def set_transform(im, x):
     for i in range(4):
         for j in range(4):
             mat44_set(a, i, j, x[i][j])
-    _example.set_transform(im, a)
+    _example._set_transform(im, a)
     free_mat44(a)
 %}
 
-- cgit v1.2.1