[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-csv
Subject:    [Csv] Request for enhancement for csv
From:       sjmachin () lexicon ! net (John Machin)
Date:       2005-10-07 20:54:45
Message-ID: 4346E095.4090806 () lexicon ! net
[Download RAW message or body]

skip at pobox.com wrote:

>    paul> Thats more or less what I do now (but have put the code in the csv
>    paul> module so its a one line call).
>
>    paul> Do you think it is likely to be worth submitting that as a patch
>
>I'm ambivalent about it.  I've never needed that functionality before and
>don't imagine many people will need it.  Also, it's not clear to me that the
>KeyError exception raised when there's a mismatch between the expected and
>actual column names is all that much worse than the ValueError I raised in
>my example.  There's also the added complexity for the DictReader API.  In
>your formulation the fieldnames argument is optional except when strict is
>given.
>
>If it was to go into the module, I'd propose that DictReader be subclassed
>to implement your semantics.
>
>Inputs from the other readers are always welcome as well.
>
>Skip
>
>  
>
My take: not in the module. What Paul wants to do is just *one* variant 
of column-name checking that I've used or seen in practice. Others: (a) 
case insensitive (b) some columns are mandatory, others optional with 
default values (c) some mandatory columns, others are "write your own 
ticket" columns i.e. the name is not known in advance. The ratio of time 
taken to code such stuff in Python to time taken to locate & parse the 
docs is too low IMHO.

Cheers,
John


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic