Open hoxha-saber opened 9 months ago
Hi @hoxha-saber I believe we should be able to get this working with traits once lifetimes are introduced.
Note your code isn't working because String
is memory only (it's allocated to the heap), you can still do it with register passable types:
fn main() raises:
let n : PythonObject = [5, "apple"]
print(n)
Bug description
The following causes an error
The error is:
I didn't see any indication from the documents that Python objects containing heterogenous types weren't supported. A common use case could be in python dictionaries where the key and values are different types. Are there any plans to make this work in the future? Thanks
Steps to reproduce
Run the above program
System information