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 <rep...@bugs.python.org>
<https://bugs.python.org/issue31504>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to