it should still fix some issue The problem lies in this line that is deciding which square to consider next for the route:

code :

```
current = min([kv for kv in f_score.items() if kv[0] in open_set], key=lambda i: i[1])[0]
print("{} fscore: {} gscore: {}".format(current,
f_score[current],
g_score[current]))
```

```
Python 3.5 Python 3.8
----------------------- -----------------------
(1, 1) fscore: 8 gscore: 0 (1, 1) fscore: 8 gscore: 0
(2, 2) fscore: 8 gscore: 1 (2, 2) fscore: 8 gscore: 1
(3, 3) fscore: 8 gscore: 2 (3, 3) fscore: 8 gscore: 2
(4, 4) fscore: 8 gscore: 3 (4, 4) fscore: 8 gscore: 3
(1, 2) fscore: 9 gscore: 1 (5, 5) fscore: 8 gscore: 4 <= Here they start to vary
(3, 2) fscore: 9 gscore: 2 (6, 6) fscore: 8 gscore: 5
(2, 1) fscore: 9 gscore: 1 (7, 7) fscore: 8 gscore: 6
(2, 3) fscore: 9 gscore: 2 (8, 8) fscore: 8 gscore: 7
(4, 3) fscore: 9 gscore: 3 (9, 9) fscore: 8 gscore: 8
(5, 4) fscore: 9 gscore: 4 (1, 1) fscore: 8 gscore: 0
(3, 4) fscore: 9 gscore: 3 (2, 2) fscore: 8 gscore: 1
(6, 4) fscore: 10 gscore: 5 (3, 3) fscore: 8 gscore: 2
(1, 3) fscore: 10 gscore: 2 (4, 4) fscore: 8 gscore: 3
(7, 5) fscore: 10 gscore: 6 (1, 2) fscore: 9 gscore: 1
(6, 6) fscore: 10 gscore: 7 (2, 1) fscore: 9 gscore: 1
(7, 7) fscore: 10 gscore: 8 (2, 3) fscore: 9 gscore: 2
(4, 2) fscore: 10 gscore: 3 (3, 2) fscore: 9 gscore: 2
(5, 3) fscore: 10 gscore: 4 (3, 4) fscore: 9 gscore: 3
(7, 6) fscore: 10 gscore: 7 (4, 3) fscore: 9 gscore: 3
(8, 7) fscore: 10 gscore: 8 (5, 4) fscore: 9 gscore: 4
(9, 8) fscore: 10 gscore: 9 (1, 3) fscore: 10 gscore: 2
(3, 1) fscore: 10 gscore: 2 (3, 1) fscore: 10 gscore: 2
(8, 8) fscore: 10 gscore: 9 (2, 4) fscore: 10 gscore: 3
(8, 6) fscore: 10 gscore: 7 (4, 2) fscore: 10 gscore: 3
(9, 7) fscore: 10 gscore: 8 (5, 3) fscore: 10 gscore: 4
(9, 9) fscore: 10 gscore: 10 (6, 4) fscore: 10 gscore: 5
Here Python3.5 is done (7, 5) fscore: 10 gscore: 6
in 26 steps ... Not done yet! ...
Python3.8 keeps going
to 36 steps total
```

```
def test_indirect_route(self):
"""
01234567890
0EEEEEEEEEEE
1EsPPPPPPPPE
2EP.PPPPPPPE
3EPP.PPPPPPE
4EPPP...PPPE
5EWWWWWW.WWE
6EPPPPP.PPPE
7EPPPPPP.PPE
8EPPPPPPP.PE
9EPPPPPPPPgE
0EEEEEEEEEEE
Not the route I would have chosen, but the same length
"""
test_map = Map()
for x in range(1, 7):
test_map[(x, 5)] = 'water'
for x in range(8, 10):
test_map[(x, 5)] = 'water'
route = a_star((1, 1), (9, 9), test_map)
self.assertIn((1, 1), route)
self.assertIn((7, 5), route)
self.assertIn((9, 9), route)
self.assertEqual(11, len(route))
```