go-python / gopy

gopy generates a CPython extension module from a go package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

yangzh opened this issue · 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!

Assuming that fixes it -- lmk if not.