Yep! That's exactly my feeling too. Maybe add these to the "reasonable" comparisons:
sorted(d1.values()) == sorted(d2.values()) Counter(d1.values()) == Counter(d2.values()) But generally everything I might want to compare about values has a straightforward spelling already. On Fri, Jul 26, 2019, 8:02 AM Greg Ewing <greg.ew...@canterbury.ac.nz> wrote: > David Mertz wrote: > > > > We COULD do that with > > `d1.values() == d2.values()` in principle. This "DictValuesComparison" > > object could have methods like `.equal_as_set()` and > > `.equal_as_list()`. However, that's a lot of machinery for very little > > gain. > > Particularly as there are already perfectly good ways to express those: > > set(d1.values()) == set(d2.values()) > > list(d1.values()) == list(d2.values()) > > -- > Greg > _______________________________________________ > Python-Dev mailing list -- python-dev@python.org > To unsubscribe send an email to python-dev-le...@python.org > https://mail.python.org/mailman3/lists/python-dev.python.org/ > Message archived at > https://mail.python.org/archives/list/python-dev@python.org/message/OHF54Z54D2ERD4L4P72JCJQ5EB3LS5XZ/ >
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/CIZSAMTHRV524GZNWRUU6MCXMOUVRJ5E/