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):
>         return True
>     else: return False
>
> The function must work whether you pass it
> foo(str.endswith,"blaahh","ahh"), or
> foo(str.startswith,"blaahh","aah"). This is a really bad example, but
> it gets the point across that similar functions must have similar
> parameters in order to be Pythonic.

Thanks for explanation, this point makes sense. And I agree that I can
hardly imagine any use of both parameters :-).

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to