Yuck. But sorted(values) doesn't sort by ID, so the comparison is False, despite both lists being equal.