[issue24898] Documentation for str.find() is confusing

2015-08-20 Thread Ted Lemon

Ted Lemon added the comment:

Hm, okay, that explains it.   I was previously mystified.  How about this as a 
refinement on your proposal, though:

Return the lowest index in the string where substring sub is found within the 
string.  Optional arguments start and end restrict the search to the slice of 
the string, s[start:end].  Returned index is relative to the beginning of the 
string, not the beginning of the slice. Return -1 if sub is not found.

--

___
Python tracker 
<http://bugs.python.org/issue24898>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24898] Documentation for str.find() is confusing

2015-08-19 Thread Ted Lemon

New submission from Ted Lemon:

The documentation for str.find() on python.org, for all current versions, says:

Return the lowest index in the string where substring sub is found, such that 
sub is contained in the slice s[start:end]. Optional arguments start and end 
are interpreted as in slice notation. Return -1 if sub is not found.

I think that what is meant here is this:

Return the lowest index in a string s where substring sub is found, such that 
if a is the returned index, and b == a + len(sub), sub is contained in the 
slice s[a:b]. Optional arguments start and end are interpreted as in slice 
notation. Return -1 if sub is not found.

--
assignee: docs@python
components: Documentation
messages: 248872
nosy: Ted Lemon, docs@python
priority: normal
severity: normal
status: open
title: Documentation for str.find() is confusing
versions: Python 3.6

___
Python tracker 
<http://bugs.python.org/issue24898>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com