add sorting key for some sorted functions

for sorting nested lists
This commit is contained in:
Roman Trapeznikov 2020-04-10 13:58:28 +03:00
parent 78e70e002c
commit ea99108202
2 changed files with 3 additions and 2 deletions

View File

@ -1451,8 +1451,7 @@ class GatherWindow(ba.Window):
key=lambda p: (
p['queue'] is None, # Show non-queued last.
p['ping'] if p['ping'] is not None else 999999,
p['index'],
p))
p['index']))
existing_selection = self._public_party_list_selection
first = True

View File

@ -303,4 +303,6 @@ def make_hash(obj: Any) -> int:
for k, v in new_obj.items():
new_obj[k] = make_hash(v)
# NOTE: there is sorted works correctly because it compares only
# unique first values (i.e. dict keys)
return hash(tuple(frozenset(sorted(new_obj.items()))))