osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dealing with dicts in doctest


05.07.18 20:57, Steven D'Aprano ????:
> I think that's really clever. Is it too clever? How do you deal with
> dicts in doctests?

There was a proposition for adding a doctest option for 
order-insensitive matching (like NORMALIZE_WHITESPACE and ELLIPSIS). But 
it was rejected because there is a simple alternative:

     >>> func(1) == {'a': 1, 'b': 2, 'c': 3}
     True

And since 3.7 the need of this feature was reduced.