[Csv] This surprised me

Skip Montanaro skip at pobox.com
Wed Feb 12 15:31:25 CET 2003


    >> Correct.  But you indicated that was no longer necessary.  I was
    >> wondering where the error checking went to.

    Andrew> I decided it wasn't necessary - if the instance has the
    Andrew> necessary bits and no more, we can use it as parameters, whether
    Andrew> it's a descendant of Dialect or not.

Yeah, but what if it has no necessary bits?  Shouldn't the user be alerted
to that fact?

    >>> import csv
    >>> class foo: pass
    ... 
    >>> rdr = csv.reader(["a,b,c\r\n"], dialect=foo)
    >>> rdr.next()
    ['a', 'b', 'c']

If nothing else, we need to define the specific defaults for the various
parameters.  In the above case, clearly my foo class isn't overriding
anything.

Skip


More information about the Csv mailing list