Commit Graph

10 Commits

Author SHA1 Message Date
Skip Montanaro dffeed3ffa Make the fieldnames argument optional in the DictReader. If self.fieldnames
is None, the next row read is used as the fieldnames.  In the common case,
this means the programmer doesn't need to know the fieldnames ahead of time.
The first row of the file will be used.  In the uncommon case, this means
the programmer can set the reader's fieldnames attribute to None at any time
and have the next row read as the next set of fieldnames, so a csv file can
contain several "sections", each with different fieldnames.
2003-10-03 14:03:01 +00:00
Skip Montanaro 3f7a94824e **kwds arg was missing from __init__ for Dict{Reader,Writer} classes.
will backport.
2003-09-06 19:52:12 +00:00
Fred Drake 6f7b213dda use the long names for re compilation options; this makes it easier to
figure out what the code is doing
2003-09-02 16:01:07 +00:00
Raymond Hettinger f31cb0cbcf One more multiple exception catch should be in a tuple. 2003-06-12 04:05:00 +00:00
Raymond Hettinger abe14e6f04 The multiple exception catch should be in a tuple. 2003-06-12 03:59:17 +00:00
Raymond Hettinger 39a5592001 SF Patch #744104: Remove eval() from csv
Eliminates the eval() step in the csv module resulting in better
security, more clarity, and a little speed.

The idea is to make successive attempts to coerce the string to
a python type:
    int(s), long(s), float(s), etc.

As a by-product, eliminates a bare 'except' statement.
2003-06-12 03:01:55 +00:00
Skip Montanaro 7789237331 * Correct Sniffer doc to correspond to the implementation.
* Add optional delimiters arg to Sniffer.sniff() which restricts the set of
  candidate field delimiters.
2003-05-19 15:33:36 +00:00
Skip Montanaro 1448d4719c rework Sniffer api significantly 2003-04-25 14:47:16 +00:00
Fred Drake 7c852f33a2 Attempt to deal with some obvious errors in the code. These were all
due to using a single module-level namespace where multiple namespaces
were used before.

There *really* need to be tests for the sniffer stuff.  This could
have been avoided.

Skip, please review, and add sniffer tests!
2003-04-25 14:27:00 +00:00
Skip Montanaro 04ae7056cf cvs is going to be a module again 2003-04-24 20:21:31 +00:00