gopy icon indicating copy to clipboard operation
gopy copied to clipboard

fmt.Stringer on the Go side didn't get called properly from __str__ on the Python side.

Open yangzh opened this issue 2 years ago • 0 comments

I tried to usegopy build -vm=python3 -no-make -no-warn -rename <module_name> to convert some Go class which implements fmt.Stringer interface: has String() string method defined.

However, on Python side, __str__(self) relies on self.String(), which does NOT exist. I suspect the use of -rename converted the Go method of String() string to string() on the Python side. And yes, the generated code confirmed my suspicion.

gopy maintainer, can you help diagnose and fix this issue? thanks!

yangzh avatar Sep 18 '23 04:09 yangzh