[Python-Dev] New string method - splitquoted
Heiko Wundram
me+python-dev at modelnine.org
Thu May 18 12:38:29 CEST 2006
Am Donnerstag 18 Mai 2006 12:26 schrieb Giovanni Bajo:
> I believe the standard library already covers common usage. There will
> surely be cases where a custom lexer/splitetr will have to be written, but
> that's life
The csv data field parser handles all common usage I have encountered so far,
yes. ;-) But, generally, you can't (easily) get at the method that parses a
data field directly, that's why I proposed to publish that method with
keyword arguments. (actually, I've only tried getting at it when the csv
module was still plain-python, I wouldn't even know whether the "method" is
exported now that the module is written in C).
I've had the need to write a custom lexer time and again, and generally, I'd
love to have a little more general string interpretation facility available
to spare me from writing a state automaton... But as I said before,
the "simple" patch that was proposed here won't do for my case. But I don't
know if it's worth the trouble to actually write a more general version,
because there are quite some different pitfalls that have to be overcome... I
still remain +0.5 for adding something like this to the stdlib, but only if
it's overly general so that it can handle all cases the csv module can
handle.
--- Heiko.
More information about the Python-Dev
mailing list