Igor
Igor
MModular
Created by Igor on 9/25/2023 in #questions
Raise returns a string?
I'm running this code:
fn test() raises -> StringRef:
raise Error("Test")


fn main() raises:
let res = test()

print(res) # prints "Test"
fn test() raises -> StringRef:
raise Error("Test")


fn main() raises:
let res = test()

print(res) # prints "Test"
It seems like if I raise an error on a function that returns a String then the error value becomes the return value... Is that expected behavior?
4 replies
MModular
Created by Igor on 9/19/2023 in #questions
_ImmutableString
How can I convert a _ImmutableString to String or StringRef?
8 replies
MModular
Created by Igor on 9/12/2023 in #questions
`len` of a `PythonObject`
I have a Python list and I want to get the Len of it, but lenPythonObj always seems to return "2"...
3 replies
MModular
Created by Igor on 9/9/2023 in #questions
kwargs
I'm trying to use a Python function that needs kwargs how do you deal with them?
4 replies