[Csv] CSV interface question

Skip Montanaro skip at pobox.com
Thu Jan 30 02:57:30 CET 2003


    Cliff> Consider now the programmer actually defining a new dialect:
    Cliff> Passing a class or other structure (a dict is fine), they can
    Cliff> create this on the fly with minimal work.  Using a *string*, they
    Cliff> must first "register" that string somewhere (probably in the
    Cliff> mapping we agree upon) before they can actually make the function
    Cliff> call.  Granted, it's only a an extra step, but it requires a bit
    Cliff> more knowledge (of the mapping) and doesn't seem to provide a
    Cliff> real benefit.  If you prefer a mapping to a class, that is fine,
    Cliff> but lets pass the mapping rather than a string referring to it:

Somewhere I think we still need to associate string names with these
beasts.  Maybe it's just another attribute:

    class dialect:
        name = None

    class excel(dialect):
        name = "excel"
        ...

They should all be collected together for operation as a group.  This could
be so a GUI knows all the names to present or so a sniffer can return all
the dialects with which a sample file is compatible.  Both operations
suggest the need to register dialects somehow.

Skip

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



More information about the Csv mailing list