From: David Morton Date: 2008-01-24T04:49:26+09:00 Subject: Re: How to improve this code? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jan 23, 2008, at 1:21 PM, 7stud -- wrote: > David Morton wrote: >>> >>> In particular, the csv module is so inefficient, James Gray wrote >>> his >>> own module and called it fastercsv. >> >> Most of the time, it's better to look for standard libraries or at >> least good third party libraries rather than re-inventing the wheel >> though. Most of the time, when one re-invents the wheel, one gets >> it >> wrong. >> > > Looking for a standard library module so that you can split a string > on > a comma is a ridiculous waste of time. At some point, you actually > have to be able to program something. If you think parsing a CSV file is as simple as splitting on a comma, you need to think again. Look up RFC 4180. It's not a hard format, but it *is* more than just "foo,bar".split(','). It's enough code that I'd rather use an existing library than to waste a ridiculous amount of time doing it (correctly) myself. David Morton Maia Mailguard http://www.maiamailguard.com mortonda@dgrmm.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHl5pEUy30ODPkzl0RAkPDAKCcpJjxQZfSjGIuPBvtY0AQg7nU7wCeJT9s vP9SrJlvtHuAzElaQgTvZQQ= =Qyq3 -----END PGP SIGNATURE-----