[Csv] another _csv question

Skip Montanaro skip at pobox.com
Wed Feb 5 03:39:27 CET 2003


    >> I suspect we should provide a __setattr__ that forces Dialect
    >> instances to be read-only.

    Andrew> I think this is an unnecessary restriction. You might want to do
    Andrew> something like:

    Andrew>     class SnifferDialect(csv.Dialect):
    Andrew>         pass

    Andrew>     def sniff(...):
    Andrew>         dialect = SnifferDialect()
    Andrew>         ... try stuff ...
    Andrew>         dialect.delimiter = '\t'
    Andrew>         ... try more stuff ...

I can buy that.  Maybe what we need then is some way to force validation
after changes are made, but before the dialect info is tossed over the wall
to the low-level module.

Skip



More information about the Csv mailing list