go-python / go-python/gopy

[]byte Parameter Results in Unexpected Integer Type

Abierto
#344 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
2.3k
Forks
136
Merge medio
14 min
PR fusionados (30 d)
2

Descripción

I am facing an issue with Golang-to-Python interoperability. Specifically, when I call a Python function from Golang and pass a []byte data as a parameter, the Python function unexpectedly receives an integer instead of the intended MengByte/bytes object.

Code:

test.go
```go
package hujan

type MengByte []byte
type Fungsi func(MengByte)

func Test(fun Fungsi) {
fun(MengByte{255, 211, 21, 23, 0, 1, 2, 3, 82, 2, 33})
}
```

test.py
```python
from out.hujan import Test, MengByte

def fun(arg: MengByte):
print('arg: ', type(arg))
return arg

Test(fun)
```

I would appreciate assistance in resolving this issue and ensuring that the Python function correctly receives the MengByte/bytes object.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.