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

2007-04-20 Thread Steven D'Aprano
On Fri, 20 Apr 2007 23:20:39 -0300, Gabriel Genellina wrote: >>> ... 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 :) D'oh! -- Steven. -- http://mail.pyt

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

2007-04-20 Thread Gabriel Genellina
En Fri, 20 Apr 2007 23:13:23 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: > On Fri, 20 Apr 2007 15:21:56 -0700, John Machin wrote: > >> On Apr 20, 9:12 am, Steven D'Aprano >> <[EMAIL PROTECTED]> wrote: >>> >>> You can do this: >>> >>> p = 0 >>> while text: >>> p = text.find('parrot',

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

2007-04-20 Thread Steven D'Aprano
On Fri, 20 Apr 2007 15:21:56 -0700, John Machin wrote: > On Apr 20, 9:12 am, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Thu, 19 Apr 2007 13:57:16 -0700, Boris Dusek wrote: >> >> > what is the use-case of parameter "start" in string's "endswith" >> >> > method? >> >> >> def foo(function,ins

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

2007-04-20 Thread John Machin
On Apr 20, 9:12 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 19 Apr 2007 13:57:16 -0700, Boris Dusek wrote: > >> > what is the use-case of parameter "start" in string's "endswith" > >> > method? > > >> def foo(function,instance,param): > >> if function(instance,param,2,4): > >>

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

2007-04-19 Thread Steven D'Aprano
On Thu, 19 Apr 2007 13:57:16 -0700, Boris Dusek wrote: >> > what is the use-case of parameter "start" in string's "endswith" >> > method? > >> def foo(function,instance,param): >> if function(instance,param,2,4): >> return True >> else: return False >> >> The function must work wh

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

2007-04-19 Thread John Machin
On Apr 20, 6:08 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Boris Dušek wrote: > > Hello, > > > what is the use-case of parameter "start" in string's "endswith" > > method? Consider the following minimal example: > > > a = "testing" > > suffix="ing" > > a.endswith(suffix, 2) > > > Significance of

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

2007-04-19 Thread John Machin
On Apr 20, 6:36 am, subscriber123 <[EMAIL PROTECTED]> wrote: > On Apr 19, 3:58 pm, Boris Dušek <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hello, > > > what is the use-case of parameter "start" in string's "endswith" > > method? Consider the following minimal example: > > > a = "testing" > > suffi

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

2007-04-19 Thread Boris Dušek
On Apr 19, 10:36 pm, subscriber123 <[EMAIL PROTECTED]> wrote: > On Apr 19, 3:58 pm, Boris Dušek <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > what is the use-case of parameter "start" in string's "endswith" > > method? > def foo(function,instance,param): > if function(instance,param,2,4):

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

2007-04-19 Thread subscriber123
On Apr 19, 3:58 pm, Boris Dušek <[EMAIL PROTECTED]> wrote: > Hello, > > what is the use-case of parameter "start" in string's "endswith" > method? Consider the following minimal example: > > a = "testing" > suffix="ing" > a.endswith(suffix, 2) > > Significance of "end" is obvious. But not so for "s

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

2007-04-19 Thread Larry Bates
Boris Dušek wrote: > Hello, > > what is the use-case of parameter "start" in string's "endswith" > method? Consider the following minimal example: > > a = "testing" > suffix="ing" > a.endswith(suffix, 2) > > Significance of "end" is obvious. But not so for "start". > > Let's assume the "end" pa

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

2007-04-19 Thread Boris Dušek
Hello, what is the use-case of parameter "start" in string's "endswith" method? Consider the following minimal example: a = "testing" suffix="ing" a.endswith(suffix, 2) Significance of "end" is obvious. But not so for "start". Let's assume the "end" parameter is not used - then the function sho