From 6030f597410d1a64cffa72bfeb52d9cd7ca2b46a Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 28 Nov 2018 07:27:49 +0000 Subject: [PATCH] Fix operator Python example for -builtin Output was incorrect for -builtin as custom __str__ was not being called. --- Examples/python/operator/example.i | 1 + 1 file changed, 1 insertion(+) diff --git a/Examples/python/operator/example.i b/Examples/python/operator/example.i index e37e76b3e..1e4b7ce34 100644 --- a/Examples/python/operator/example.i +++ b/Examples/python/operator/example.i @@ -17,6 +17,7 @@ %include "example.h" /* An output method that turns a complex into a short string */ +%feature("python:slot", "tp_str", functype="reprfunc") Complex::__str__; // For -builtin option to use __str__ in the tp_str slot %extend Complex { char *__str__() { static char temp[512];