On 6/10/2015 6:10 PM, Devin Jeanpierre wrote:
The problem is that there are two different ways repr might write out a dict equal to {'a': 1, 'b': 2}. This can make tests brittle
Not if one compares objects rather than string representations of objects. I am strongly of the view that code and tests should be written to directly compare objects as much as possible.
it's why doctest fails badly at examples involving dictionaries.
or sets or addresses or object ids or locale-dependent strings or random numbers or values dependent on random numbers.
-- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list