Open josharian opened 5 years ago
Another variant:
$ python2 -c "'a'.index('', 1, 0)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ValueError: substring not found
(exit 1)
$ python3 -c "'a'.index('', 1, 0)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ValueError: substring not found
(exit 1)
$ starlark-go -c "'a'.index('', 1, 0)"
(exit 0)
I have a fix for the original issue but not this second one. Will continue later.
Care to send a CL?
Yes. I haven't forgotten about starlark, it just got backburnered for a bit as I struggle with go-fuzz and go/packages. I'll circle around at some point and work on this and other things I've promised to do. If there's anything urgent, please let me know.
Definitely a corner case: only occurs when searching for the empty string and the occurrence requested is higher than the length of the input string.