From baaf68bb303aeb5be10d8eab6cb162bd1f205d9f Mon Sep 17 00:00:00 2001 From: SimpleArt <71458112+SimpleArt@users.noreply.github.com> Date: Wed, 6 Jan 2021 10:23:43 -0500 Subject: [PATCH] Removed walrus operators --- src/EasyGA.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/EasyGA.py b/src/EasyGA.py index 7c56849..b5eca9a 100644 --- a/src/EasyGA.py +++ b/src/EasyGA.py @@ -190,12 +190,14 @@ class GA(Attributes): # First non-zero tolerance after amount_converged/4 for i in range(amount_converged//4, len(self.population)): - if (tol_i := tol(i)) > 0: + tol_i = tol(i) + if tol_i > 0: break # First significantly different tolerance for j in range(i, len(self.population)): - if (tol_j := tol(j)) > 2*tol_i: + tol_j = tol(j) + if tol_j > 2*tol_i: break