[Python-Dev] ConfigParser to save with order
Facundo Batista
facundobatista at gmail.com
Mon Jan 9 18:08:15 CET 2006
2006/1/7, Guido van Rossum <guido at python.org>:
> I think it's moot unless you also preserve comments. Ideally would be
> something that prserved everything (ordering, blank lines, comments
> etc.) from how it was read in. Modifying a value should keep its
> position. Adding a value should add it to the end of the section it's
> in (unless there are cases where ordering is important to the
> semantics -- are there?).
Not in my case.
We can rewrite ConfigParser to store everything and write it back in
the exact order it took it, with new values at the end of each section
(or where the user inserted it), but it'll took a big rewrite of the
module: right now it's using dictionaries and should use lists to
achieve that behaviour.
What I wanted to add to the module was predicatibility: a very needed
feature when you're writing test cases (and that's where I got bite).
. Facundo
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
More information about the Python-Dev
mailing list