Duncan Booth wrote:
> bruno at modulix wrote:
> 
> 
>>>Otherwise, just to be informed, what advantage does rstrip() have over
>>>[:-1] (if the two cases are considered uneventfully the same)?
>>
>>1/ if your line doesn't end with a newline, line[:-1] will still remove
>>the last caracter.
>>
> 
> In particular, if the last line of the file doesn't end with a newline then 
> the last line you read won't have a newline to be stripped.

Thanks - I knew there was a corner case for files, but couldn't remember
it exactly.

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to