Open Shaikh-Ubaid opened 2 months ago
I have a working fix ready for this. I wish to discuss some design decisions before pushing the changes.
We essentially need generics to fully achieve this. The error in the above example stated list[str]
because that is the only implementation we currently have for list()
inside lpython_builtin.py
. I have written some implementations for list of integers and floats, but we cannot handle arbitrary nesting this way. For now, we may handle some nesting by hand, like list[list[i32]]
. Although it is not a good idea, it will help us to test methods like dict.keys
and dict.values
more clearly. Currently tests for both these methods check for the length of the returned list.
@Shaikh-Ubaid @certik @czgdp1807 What is your take on this?