[Csv] CSV interface question

Cliff Wells LogiplexSoftware at earthlink.net
Wed Jan 29 18:31:02 CET 2003


On Wed, 2003-01-29 at 02:50, Dave Cole wrote:
> >>>>> "Andrew" == Andrew McNamara <andrewm at object-craft.com.au> writes:
> 
> >> Maybe we should consider a "container of options" class (of which
> >> the dialects would be subclasses). The sniffing code could then
> >> return an instance of this class (which wouldn't necessarily be a
> >> dialect). With this, you might do things like:
> 
> Andrew> Another thought - rather than specify the dialect name as a
> Andrew> string, it could be specified as a class or instance -
> Andrew> something like:
> 
> Andrew>     csv.reader(fileobj, csv.dialect.excel)
> 
> Andrew> Thoughts?
> 
> Is there a downside to this?  I can't see one immediately.

Actually, there is a downside to using strings, as you will see if you
look at the code I posted a little while ago.  By taking dialect as a
string, it basically precludes the user rolling their own dialect except
as keyword arguments.  After working on this, I'm inclined to have the
programmer pass a class or other structure.

-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308

_______________________________________________
Csv mailing list
Csv at mail.mojam.com
http://manatee.mojam.com/mailman/listinfo/csv



More information about the Csv mailing list