Open HelloWorld-n opened 6 months ago
I think the more general issue is that strings have no "bounds checks" and do not support negative integers or limits at 0 or len(my_str). It's just was bytes in memory when using indexing with []. eg
a = str("dodo")
a[-1] # error, wrong memory address
a[5] # error, wrong memory address
a[0:10] # error, wrong memory address
With the recent fix Slice
it appears this behaviour has been fixed
Tested with mojo 2024.6.1305 (ec42f7b2)
Bug description
Code
in python gives
giving entire text but in mojo it gives
having
....
at start of text but lacking the....
at end of text.Steps to reproduce
Save
to file
test.mojo
then run that file!System information