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 ros...@gmail.com wrote: On Tue, Jul 14, 2015 at 2:58 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tuesday 14 July 2015 14:07, Ian Kelly wrote: On Mon, Jul 13, 2015 at 9:23 PM, Steven D'Aprano st...@pearwood.info

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 st...@pearwood.info wrote: On Tue, 14 Jul 2015 01:12 pm, Ian Kelly wrote: On Mon, Jul 13, 2015 at 10:56 AM, Roel Schroeven r...@roelschroeven.net wrote: Hi, Quick question: why does str have both index() and find(), while list only has

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 r...@roelschroeven.net 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?

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 r...@roelschroeven.net 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,

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 st...@pearwood.info wrote: On Tue, 14 Jul 2015 01:12 pm, Ian Kelly wrote: On Mon, Jul 13, 2015 at 10:56 AM, Roel Schroeven r...@roelschroeven.net wrote: Hi, Quick question: why does str have

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 steve+comp.lang.pyt...@pearwood.info wrote: On Tuesday 14 July 2015 14:07, Ian Kelly wrote: On Mon, Jul 13, 2015 at 9:23 PM, Steven D'Aprano st...@pearwood.info wrote: Correct. But rather than removing it, it would be better to take a leaf out

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.