Luca Delucchi wrote:

> I would like to add at line 913 this:
> 
> if dict_a.keys() != dict_b.keys():
>     return False

The ordering of the elements in the list returned by .keys() isn't
defined. E.g. for some dictionary d,

        d.keys() == d.copy().keys()

can be (and typically is) False.

Convert the keys to sets, i.e.

        if set(dict_a.iterkeys()) == set(dict_b.iterkeys()):
            return False

Or sort them; I'm not sure which is faster overall.

Aside from that, I don't think that compare_key_value_text_files()
(and the functions it uses) belongs in grass.script.core; they're too
specialised. Likewise for create_location().

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to