mardi 22 décembre 2015

Why assertDictEqual is needed if dicts can be compared by `==`?

To be honest I have always used assertDictEquals, because sometime when I didn't use it I got information, that equal dicts are not the same.

But... I know that dicts can be compared by == operator:

>>> {'a':1, 'b':2, 'c': [1,2]} == {'b':2, 'a':1, 'c': [1,2]}
True

Where I actually may need assertDictEqual?

Aucun commentaire:

Enregistrer un commentaire