>>>>> "TP" == Tim Peters <tim@zope.com> writes:
TP> Once you're used to {starts,ends}with() (about the third time
TP> you use them), they're *always* more readable than slicing.
Yep, and I prefer them to slicing even when testing the first or last
character:
if somestring.startswith('^'):
# do caret
if somestring.endswith('\n'):
# don't add it
-Barry