This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tlynn
Recipients
Date 2006-05-19.10:24:24
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
In the same way that exceptions can have a tuple of 
types specified and isinstance can take a tuple of 
types, str.startswith and endswith could take a tuple 
of possible prefixes/suffixes.

One use-case::
    if filename.endswith(('jpg', 'gif', 'png')):
         # ...
vs:
    if (filename.endswith('jpg') or filename.endswith
('gif') or
        filename.endswith('png')):
        #...

Obviously it's not a huge improvement in clarity, but 
it does seem to be an improvement to me.
History
Date User Action Args
2007-08-23 16:11:55adminlinkissue1491485 messages
2007-08-23 16:11:55admincreate