Re: str.index() and str.find() versus only list.index()

2015-07-14 Thread Todd
On Tue, Jul 14, 2015 at 7:13 AM, Chris Angelico wrote: > On Tue, Jul 14, 2015 at 2:58 PM, Steven D'Aprano > wrote: > > On Tuesday 14 July 2015 14:07, Ian Kelly wrote: > > > >> On Mon, Jul 13, 2015 at 9:23 PM, Steven D'Aprano > >> wrote: > >>> Correct. But rather than removing it, it would be be

Re: str.index() and str.find() versus only list.index()

2015-07-13 Thread Chris Angelico
On Tue, Jul 14, 2015 at 2:58 PM, Steven D'Aprano wrote: > On Tuesday 14 July 2015 14:07, Ian Kelly wrote: > >> On Mon, Jul 13, 2015 at 9:23 PM, Steven D'Aprano >> wrote: >>> Correct. But rather than removing it, it would be better to take a leaf >>> out of re.match's book and return None as the s

Re: str.index() and str.find() versus only list.index()

2015-07-13 Thread Steven D'Aprano
On Tuesday 14 July 2015 14:07, Ian Kelly wrote: > On Mon, Jul 13, 2015 at 9:23 PM, Steven D'Aprano > wrote: >> On Tue, 14 Jul 2015 01:12 pm, Ian Kelly wrote: >> >>> On Mon, Jul 13, 2015 at 10:56 AM, Roel Schroeven >>> wrote: Hi, Quick question: why does str have both index() and f

Re: str.index() and str.find() versus only list.index()

2015-07-13 Thread Ian Kelly
On Mon, Jul 13, 2015 at 9:23 PM, Steven D'Aprano wrote: > On Tue, 14 Jul 2015 01:12 pm, Ian Kelly wrote: > >> On Mon, Jul 13, 2015 at 10:56 AM, Roel Schroeven >> wrote: >>> Hi, >>> >>> Quick question: why does str have both index() and find(), while list >>> only has index()? Is there a reason fo

Re: str.index() and str.find() versus only list.index()

2015-07-13 Thread Steven D'Aprano
On Tue, 14 Jul 2015 01:12 pm, Ian Kelly wrote: > On Mon, Jul 13, 2015 at 10:56 AM, Roel Schroeven > wrote: >> Hi, >> >> Quick question: why does str have both index() and find(), while list >> only has index()? Is there a reason for that, or is it just an historical >> accident? > > Historical a

Re: str.index() and str.find() versus only list.index()

2015-07-13 Thread Ian Kelly
On Mon, Jul 13, 2015 at 10:56 AM, Roel Schroeven wrote: > Hi, > > Quick question: why does str have both index() and find(), while list only > has index()? Is there a reason for that, or is it just an historical > accident? Historical accident, I think. If it were to be redone, I doubt that str.f

str.index() and str.find() versus only list.index()

2015-07-13 Thread Roel Schroeven
Hi, Quick question: why does str have both index() and find(), while list only has index()? Is there a reason for that, or is it just an historical accident? Best regards, Roel -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. --