kubat aytekin <[email protected]> added the comment:
Or keep the reverse mapping in another dict:
count = Counter()
reverse_mapping = dict()
for x in all_the_items:
count.update(keyfunc(x))
reverse_mapping[keyfunc(x)] = x
Anyways I'm closing it as it is a partial duplicate of key-transforming
dictionaries.
----------
resolution: -> duplicate
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue45338>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com