[Python-ideas] What are the strong use cases for str.rindex()?
johnlinp at gmail.com
Tue Apr 23 02:44:25 EDT 2019
I found that there are str.index() and str.rindex(), but there is only
list.index() and no list.rindex(). So I filed the issue
https://bugs.python.org/issue36639 to provide list.rindex(). However, the
issue was rejected and closed with the comment:
> There were known, strong use cases for str.rindex(). The list.rindex()
method was intentionally omitted. AFAICT no compelling use cases have
arisen, so we should continue to leave it out. In general, we don't grow
the core APIs unnecessarily.
However, I am not sure what the known, strong use cases for str.rindex()
are. Why doesn't the strong use cases apply on list.rindex()? Could anyone
give me some examples? Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas