Fix operator Python example for -builtin
Output was incorrect for -builtin as custom __str__ was not being called.
This commit is contained in:
parent
865dc1e71c
commit
6030f59741
1 changed files with 1 additions and 0 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
%include "example.h"
|
%include "example.h"
|
||||||
|
|
||||||
/* An output method that turns a complex into a short string */
|
/* 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 {
|
%extend Complex {
|
||||||
char *__str__() {
|
char *__str__() {
|
||||||
static char temp[512];
|
static char temp[512];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue