Dimitar Yosifov
Dimitar Yosifov
MModular
Created by Mahmoud Abduljawad on 9/17/2023 in #questions
How to store PythonObject in DynamicVector?
This is as far as I got 🙂
let obj = test_mod.return_int()
var dv = DynamicVector[Pointer[PythonObject]]()
dv.push_back(obj.py_object)
let obj = test_mod.return_int()
var dv = DynamicVector[Pointer[PythonObject]]()
dv.push_back(obj.py_object)
error: invalid call to 'push_back': method argument #0 cannot be converted from 'PyObjectPtr' to 'Pointer[PythonObject]
error: invalid call to 'push_back': method argument #0 cannot be converted from 'PyObjectPtr' to 'Pointer[PythonObject]
No idea where to get PyObjectPtr so it can be specified in DynamicVector parameter. Not sure if it even makes sense. Compiler errors are confusing in different scenarios. There's a lot of undocumented stuff.
6 replies
MModular
Created by Mahmoud Abduljawad on 9/17/2023 in #questions
How to store PythonObject in DynamicVector?
"let" defines a variable that's immutable. "let dv = DynamicVectorPythonObject" Have you tried using "var"?
6 replies