[docs] [issue31504] Documentation for return value for string.rindex is missing when search string is empty

Ashok Bakthavathsalam report at bugs.python.org
Mon Sep 18 04:57:10 EDT 2017

Ashok Bakthavathsalam added the comment:

The documentation (https://docs.python.org/3/library/stdtypes.html#str.find) does not describe what will be the behaviour if the substring is "". 

And by the way, as per https://docs.python.org/3/reference/expressions.html#membership-test-operations, 

    Empty strings are always considered to be a substring of any other 
    string, so "" in "abc" will return True.

Returning an invalid index value, although confusing, should at least be documented in some form.


Python tracker <report at bugs.python.org>

More information about the docs mailing list