Fix operator Python example for -builtin

Output was incorrect for -builtin as custom __str__ was not being
called.
This commit is contained in:
William S Fulton 2018-11-28 07:27:49 +00:00
parent 865dc1e71c
commit 6030f59741
1 changed files with 1 additions and 0 deletions

View File

@ -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];