Significance of "start" parameter to string method "endswith"

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Apr 20 22:20:39 EDT 2007


En Fri, 20 Apr 2007 23:13:23 -0300, Steven D'Aprano  
<steve at REMOVE.THIS.cybersource.com.au> escribió:

> On Fri, 20 Apr 2007 15:21:56 -0700, John Machin wrote:
>
>> On Apr 20, 9:12 am, Steven D'Aprano
>> <s... at REMOVE.THIS.cybersource.com.au> wrote:
>>>
>>> You can do this:
>>>
>>> p = 0
>>> while text:
>>>     p = text.find('parrot', p)
>>>     do_something_with(buffer, p)
>>>
>>> which avoids copying text unnecessarily.
>>
>> ... but increases the care and attention required when coding:
>
> There are always trade-offs.

... and you still need more attention when replying - read again your own  
reply :)

-- 
Gabriel Genellina




More information about the Python-list mailing list