Minor patch - str.lstrip() in place of loops

Neil Shepperd nshepperd at gmail.com
Fri Aug 8 06:10:01 PDT 2008


Hi,

Looking through the code, I found some loops such as:

while filepath.startswith("/"):
        filepath = filepath[1:]
    return filepath

The obvious thing to do was to submit a patch replacing such things
with 'return filepath.lstrip("/")'. I personally think it improves
readability, and I'm sure the versions of that lack lstrip() are no
longer intended to be supported by smart.
I hope this is appropriate to the list.

Neil Shepperd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lstrip.patch
Type: text/x-patch
Size: 4532 bytes
Desc: not available
URL: <http://lists.labix.org/pipermail/smart-labix.org/attachments/20080808/c01c7fa5/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.labix.org/pipermail/smart-labix.org/attachments/20080808/c01c7fa5/attachment-0002.pgp>


More information about the Smart mailing list