How to create a dict based on such a file?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Feb 15 00:36:02 EST 2011


On Mon, 14 Feb 2011 19:41:00 -0800, alex23 wrote:

> On Feb 15, 9:06 am, Steven D'Aprano <steve
> +comp.lang.pyt... at pearwood.info> wrote:
>> As I see it, the biggest problems with INI files are:
>>
>> * the INI file module that comes with Python is quite primitive;
>>
>> * there are many slightly different behaviours you might want in an INI
>> file, and no clean or obvious way to tell which one you are dealing
>> with just from the file.
> 
> [...]
> 
>> Rant: what I *really hate* is when people use XML just because XML is
>> the in-thing, not because they need it.
> 
> Could it possibly be then that people use XML because a) the support is
> better and b) the behaviour is more predictable? That sounds more like
> good tool choice than faddism.


Of course it *could* be, but is it?

I'm certainly not denying that XML can be useful for many applications, 
nor am I saying that INI files are sufficient for everything. But if all 
you need is:

key = value

then why use this?

<entry name="key" value="value"></entry>

What benefit does it give? It just increases the number of things that 
can go wrong.


-- 
Steven



More information about the Python-list mailing list