Andy wrote:
> What do people think of this?
>
> 'prefixed string'.lchop('prefix') == 'ed string'
> 'string with suffix'.rchop('suffix') == 'string with '
> 'prefix and suffix.chop('prefix', 'suffix') == ' and '
>
> The names are analogous to strip, rstrip, and lstrip. But the functionality
> is
[Andrew Dalke]
<200 lines of thorough analysis>
> To summarize:
> - I don't think it's needed that often
> - I don't think your implementation's behavior (using an
>exception) is what people would expect
> - I don't think it does what you expect
Wow, that was a remarkably thoughtful,
On Mon, 13 Jun 2005 07:05:39 +, Andy wrote:
> What do people think of this?
>
> 'prefixed string'.lchop('prefix') == 'ed string'
> 'string with suffix'.rchop('suffix') == 'string with '
> 'prefix and suffix.chop('prefix', 'suffix') == ' and '
>
> The names are analogous to strip, rstrip, and
Andy wrote:
> What do people think of this?
>
> 'prefixed string'.lchop('prefix') == 'ed string'
> 'string with suffix'.rchop('suffix') == 'string with '
> 'prefix and suffix.chop('prefix', 'suffix') == ' and '
Your use case is
> I get tired of writing stuff like:
>
> if path.startswith('html/'