csv.py sucks for Decimal

John Machin sjmachin at lexicon.net
Sun Apr 25 06:16:20 EDT 2010


On Apr 23, 9:23 am, Phlip <phlip2... at gmail.com> wrote:

> When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in
> a Decimal() object, I must convert it to a string.

Why must you? What unwanted effect do you observe when you don't
convert it?

> the search for an alternate CSV module, without
> this bug, will indeed begin very soon!

What bug?

> I'm pointing out that QUOTE_NONNUMERIC would work better with an
> option to detect numeric-as-string, and absolve it. That would allow
> Decimal() to do its job, unimpeded.

Decimal()'s job is to create an instance of the decimal.Decimal class;
how is that being impeded by anything in the csv module?



More information about the Python-list mailing list