【发布时间】:2025-12-14 20:05:01
【问题描述】:
对于以下 C++ API:
std::vector<float> get_sweep_points()
{
return program->sweep_points;
}
Swig 生成一个包装器,它返回一个元组 (),而不是一个列表 []。为什么?如何强制 Swig 将列表返回给 python。
【问题讨论】:
-
在我的界面文件中,我已经有了 %template(vectorf) vector
;但它仍然返回一个元组而不是列表。