CSV with comments

Daniel Dittmar daniel.dittmar at sap.corp
Wed Jul 19 09:53:50 EDT 2006


Sion Arrowsmith wrote:
> Daniel Dittmar  <daniel.dittmar at sap.corp> wrote:
>>         if line [:1] == '#':
> 
> What's wrong with line[0] == '#' ? (For one thing, it's fractionally
> faster than [:1].)
> 

Matter of taste. Occasionally, I use line iterators that strip the '\n' 
from the end of each line, so empty lines have to be handled. Of course, 
in my example code, one could have moved the check for the empty line 
before the check for the comment.

Daniel



More information about the Python-list mailing list