go-python / go-python/gopy

[]byte Parameter Results in Unexpected Integer Type

オープン
#344 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
2.3k
フォーク
136
平均マージ
14分
マージ済み PR(30日)
2

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。