Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Duncan Booth schrieb: >>> if url.startswith('http://'): >>> url = url[7:] >> >> If I came across this code I'd want to know why they weren't using >> urlparse.urlsplit()... > > Right, such code can have a smell since in the case of urls, file names, > config options etc. there are specialized functions available. But I'm > not sure whether the need for removing string prefix/suffixes in general > is really so rare that we shouldn't worry to offer a simpler solution. >
One of the great things about Python is that it resists bloating the builtin classes with lots of methods that just seem like a good idea at the time. If a lot of people make a case for this function then it might get added, but I think it is unlikely given how simple it is to write a function to do this for yourself. -- http://mail.python.org/mailman/listinfo/python-list