diff options
Diffstat (limited to 'diplomacy')
-rw-r--r-- | diplomacy/utils/priority_dict.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/diplomacy/utils/priority_dict.py b/diplomacy/utils/priority_dict.py index 99a75c9..acef8f9 100644 --- a/diplomacy/utils/priority_dict.py +++ b/diplomacy/utils/priority_dict.py @@ -71,7 +71,7 @@ class PriorityDict(dict): def smallest(self): """ Finds the smallest item in the priority dict - :return: A tuple of (priority, key) for the item with the smallest priority + :return: A tuple of (priority, key) for the item with the smallest priority, or None if dict is empty. """ while self.__heap and not self.__heap[0][-1]: heapq.heappop(self.__heap) @@ -87,7 +87,7 @@ class PriorityDict(dict): """ Return a copy of this priority dict. :rtype: PriorityDict """ - return PriorityDict(**self) + return PriorityDict(**{key: entry[0] for key, entry in dict.items(self)}) def keys(self): """ Make sure keys() iterates on keys based on their priority. """ |