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.

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

Reply via email to