[Csv] This surprised me

Andrew McNamara andrewm at object-craft.com.au
Wed Feb 12 07:19:37 CET 2003


>    >> This code surprised me:
>    ...
>    Andrew> Surely there's more to your example than you quoted in this
>    Andrew> e-mail? The exception you mention came from the python code, not
>    Andrew> the C module (specifically the Dialect class), but I can't see
>    Andrew> where it referenced in the quoted code?
>
>Nope, nothing more.  I guess the point I was trying to make is that if I
>pass a dialect object which is not subclassed from csv.Dialect (as you
>suggested I should be able to do), it seems to be silently accepted.

Uh? If I recall correctly, the exception quoted came from the python
Dialect class, but it wasn't involved in the line that threw the
exception? 8-)

>    Andrew> The C code will instanciate (and thus call Dialect's _validate)
>    Andrew> when register_dialect is called, or when the class is passed to
>    Andrew> reader or writer.
>
>Correct.  But you indicated that was no longer necessary.  I was wondering
>where the error checking went to.

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

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/


More information about the Csv mailing list