diff options
author | notoraptor <stevenbocco@gmail.com> | 2018-10-25 11:21:02 -0400 |
---|---|---|
committer | notoraptor <stevenbocco@gmail.com> | 2019-04-18 11:17:48 -0400 |
commit | 95d675b66c3aeb85347474c1ea56b07d828efc0e (patch) | |
tree | cd009ae8d9339ec8301cca0a1e7f64680a60c7a3 /diplomacy | |
parent | b609e150b811700f3a429f0dd653b96f1be511d9 (diff) |
PriorityDict - Removed infinite recursion in Python 3.6.7
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. """ |