In article <mailman.84.1273630878.32709.python-l...@python.org>,
Terry Reedy  <tjre...@udel.edu> wrote:
>
>.startswith and .endswith are methods that wrap the special cases of 
>slice at an end and compare to one value. There are not necessary, and 
>save no keystrokes, but Guido obviously thought they added enough to 
>more than balance the slight expansion of the language. They were added 
>after I learned Python and I thought the tradeoff to be a toss-up, but I 
>will consider using the methods when writing didactic code meant to be 
>read by others.

They were also added after I learned Python, and I think they're great!
Using them signals that you're doing simple string checking rather than
some more arcane slicing.
-- 
Aahz (a...@pythoncraft.com)           <*>         http://www.pythoncraft.com/

f u cn rd ths, u cn gt a gd jb n nx prgrmmng.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to