diff --git a/.flake8 b/.flake8
index c38577d834b4e24d35cb43ec43e8889afc7e1bab..fbc5cc3a4f9b6f5122400a905ff8b69779435b07 100644
--- a/.flake8
+++ b/.flake8
@@ -2,7 +2,7 @@
 max-line-length = 88
 extend-ignore =
               # for black
-              E203,
+              E203, E231,
               # zealous line lengths
               E501,
               # inconsistent ruling on newlines before bin op
diff --git a/doc/scripts/make_images.py b/doc/scripts/make_images.py
index 2e6ee0c9e6fc04bf42969c419d1e6ddc00b426c1..af9f4cfef664cdf019e9bb7eb9845af4b8b7d44f 100644
--- a/doc/scripts/make_images.py
+++ b/doc/scripts/make_images.py
@@ -170,7 +170,6 @@ def morph_image(morphs, methods, filename, **kwargs):
 # Handling this case would make rendering regions more complex, but would
 # not bee too hard to support.
 def label_image(morphology, labels, filename, **kwargs):
-
     loc_sc = kwargs.get("loc_sc", 2)
     sc = kwargs.get("sc", 20)
     drawroot = kwargs.get("drawroot", True)
@@ -294,7 +293,6 @@ def label_image(morphology, labels, filename, **kwargs):
 
 
 def generate(path=""):
-
     morph_image(
         [inputs.branch_morph2],
         ["segments"],
diff --git a/example/lfp/neuron_lfp_example.py b/example/lfp/neuron_lfp_example.py
index 4b8b931566c0db76b4911d24c958a892a034581a..66d0339b15e761708b781b9c23608f3e2e419764 100755
--- a/example/lfp/neuron_lfp_example.py
+++ b/example/lfp/neuron_lfp_example.py
@@ -195,7 +195,6 @@ class Cell:
         self.diam = diamvec
 
     def simulate(self):
-
         neuron.h.finitialize(self.v_init)
         neuron.h.fcurrent()
 
diff --git a/python/example/brunel.py b/python/example/brunel.py
index ba8258e2c807f989dd7960ff8b651a3c3ea7c152..2af659ebb0c995d9ab37ed83c90226ebde1e8064 100755
--- a/python/example/brunel.py
+++ b/python/example/brunel.py
@@ -45,7 +45,6 @@ class brunel_recipe(arbor.recipe):
         poiss_lambda,
         seed=42,
     ):
-
         arbor.recipe.__init__(self)
 
         # Make sure that in_degree_prop in the interval (0, 1]
@@ -115,7 +114,6 @@ class brunel_recipe(arbor.recipe):
 
 
 if __name__ == "__main__":
-
     parser = argparse.ArgumentParser(description="Brunel model miniapp.")
     parser.add_argument(
         "-n",
diff --git a/python/example/calcium_stdp.py b/python/example/calcium_stdp.py
index 6f2871841689b0cfd38fc1f245fdaffa7daf7069..890871f36ccad86855e9363d96a46928b48929ff 100644
--- a/python/example/calcium_stdp.py
+++ b/python/example/calcium_stdp.py
@@ -107,7 +107,6 @@ class stdp_recipe(arbor.recipe):
 
 
 def run(time_lag):
-
     # Time between stimuli
     T = 1000.0 / f
 
diff --git a/python/example/gap_junctions.py b/python/example/gap_junctions.py
index 50da0589ccedf596a536f28999e99a4de077d4e3..425295813e8f1e24a68dedcdeb061c93d47050e0 100644
--- a/python/example/gap_junctions.py
+++ b/python/example/gap_junctions.py
@@ -19,7 +19,6 @@ import matplotlib.pyplot as plt
 
 
 def make_cable_cell(gid):
-
     # Build a segment tree
     tree = arbor.segment_tree()
 
diff --git a/python/example/network_two_cells_gap_junctions.py b/python/example/network_two_cells_gap_junctions.py
index 181833f963e9f77e869176912396f4c649f71259..06221bb8011696a8f6a28996780bd8158f9c723d 100755
--- a/python/example/network_two_cells_gap_junctions.py
+++ b/python/example/network_two_cells_gap_junctions.py
@@ -113,7 +113,6 @@ class TwoCellsWithGapJunction(arbor.recipe):
 
 
 if __name__ == "__main__":
-
     parser = argparse.ArgumentParser(
         description="Two cells connected via a gap junction"
     )
@@ -197,7 +196,7 @@ if __name__ == "__main__":
     si_gj_R = 1 / si_gj_g
 
     # indicate the expected equilibrium potentials
-    for (i, j) in [[0, 1], [1, 0]]:
+    for i, j in [[0, 1], [1, 0]]:
         weighted_potential = args.Vms[i] + (
             (args.Vms[j] - args.Vms[i]) * (si_gj_R + cell_R)
         ) / (2 * cell_R + si_gj_R)
diff --git a/python/example/ou_lif/ou_lif.py b/python/example/ou_lif/ou_lif.py
index c308ec18f1d6c6d50ff35f1dc76131279211f907..dde3240480753a21be2031080406f6829dcba972 100644
--- a/python/example/ou_lif/ou_lif.py
+++ b/python/example/ou_lif/ou_lif.py
@@ -20,7 +20,6 @@ def make_catalogue():
 
 
 def make_cell():
-
     # cell morphology
     # ===============
 
@@ -176,7 +175,6 @@ class ou_recipe(arb.recipe):
     # Here, if the value of the 'weight' parameter is 1, stimulation is switched on,
     # whereas if it is -1, stimulation is switched off.
     def get_generators(self, protocol):
-
         prot_name = protocol["scheme"]  # name of the protocol (defining its structure)
         start_time = protocol["time_start"]  # time at which the stimulus starts in s
         label = protocol["label"]  # target synapse (mechanism label)
@@ -255,7 +253,6 @@ class ou_recipe(arb.recipe):
 
 
 if __name__ == "__main__":
-
     # set up and run simulation
     # =========================
 
diff --git a/python/example/probe_lfpykit.py b/python/example/probe_lfpykit.py
index 0db4733fcdb92936f9e17a2a6c8525a4f48c5908..f9dff508408795cc6006ec2baf070e5e446083a4 100644
--- a/python/example/probe_lfpykit.py
+++ b/python/example/probe_lfpykit.py
@@ -162,6 +162,7 @@ I_m = I_c_samples[:, 1:] + I_m_samples[:, 1:]  # (nA)
 # Compute extracellular potentials
 ###############################################################################
 
+
 # ## Compute extracellular potentials
 # First we define a couple of classes to interface the LFPykit
 # library (https://LFPykit.readthedocs.io, https://github.com/LFPy/LFPykit):
@@ -334,15 +335,9 @@ def get_cv_polycollection(cell_geometry, V_m, vlims=[-66, -64], cmap="viridis"):
         inds = cell_geometry._CV_ind == i
         zips.append(
             create_polygon(
-                cell_geometry.x[
-                    inds,
-                ].flatten(),
-                cell_geometry.y[
-                    inds,
-                ].flatten(),
-                cell_geometry.d[
-                    inds,
-                ].flatten(),
+                cell_geometry.x[inds,].flatten(),
+                cell_geometry.y[inds,].flatten(),
+                cell_geometry.d[inds,].flatten(),
             )
         )
     polycol = PolyCollection(zips, edgecolors=colors, facecolors=colors, linewidths=0.0)
diff --git a/python/example/single_cell_bluepyopt_l5pc.py b/python/example/single_cell_bluepyopt_l5pc.py
index 2a8b6f397f60d6cdfdc3782059aae9474a96da14..502a608464a0c80d2ca8fc6e636c6eedf5c3541a 100755
--- a/python/example/single_cell_bluepyopt_l5pc.py
+++ b/python/example/single_cell_bluepyopt_l5pc.py
@@ -50,7 +50,6 @@ probe = arbor.cable_probe_membrane_voltage('"dend1"')
 
 # (6) Create a class that inherits from arbor.recipe
 class single_recipe(arbor.recipe):
-
     # (6.1) Define the class constructor
     def __init__(self, cell, probes):
         # The base C++ class constructor must be called first, to ensure that
diff --git a/python/example/single_cell_cable.py b/python/example/single_cell_cable.py
index 348fad9101f583242435c08c01314667d3226180..2a8b61c68c4baa1e56ec5978a8868029a5473816 100755
--- a/python/example/single_cell_cable.py
+++ b/python/example/single_cell_cable.py
@@ -149,7 +149,6 @@ def get_tmax(data):
 
 
 if __name__ == "__main__":
-
     parser = argparse.ArgumentParser(description="Cable")
 
     parser.add_argument(
diff --git a/python/example/single_cell_detailed_recipe.py b/python/example/single_cell_detailed_recipe.py
index cefb4dc9773345ec253b02041c1e2b0f349d86c5..436f80f64112c0cdd6deb2fcb2372fa411615037 100644
--- a/python/example/single_cell_detailed_recipe.py
+++ b/python/example/single_cell_detailed_recipe.py
@@ -73,7 +73,6 @@ cell = arbor.cable_cell(morph, decor, labels)
 
 # (5) Create a class that inherits from arbor.recipe
 class single_recipe(arbor.recipe):
-
     # (5.1) Define the class constructor
     def __init__(self):
         # The base C++ class constructor must be called first, to ensure that
diff --git a/python/test/unit/test_multiple_connections.py b/python/test/unit/test_multiple_connections.py
index b01c2fd3aa22ba400b91ec4f0c6c286ffbc9ba78..965f96c35b574e088869fa139a5aef24f4131878 100644
--- a/python/test/unit/test_multiple_connections.py
+++ b/python/test/unit/test_multiple_connections.py
@@ -28,7 +28,6 @@ NOTE: In principle, a plasticity (STDP) mechanism is employed here to test if a
 
 
 class TestMultipleConnections(unittest.TestCase):
-
     # Constructor (overridden)
     def __init__(self, args):
         super(TestMultipleConnections, self).__init__(args)
diff --git a/python/test/unit_distributed/test_domain_decompositions.py b/python/test/unit_distributed/test_domain_decompositions.py
index 5535f02fc9a3e49f1db22c1547eb2a379e1f1e46..5f4db9673956f1fe7da566b34aa28bdfa6cf6d8f 100644
--- a/python/test/unit_distributed/test_domain_decompositions.py
+++ b/python/test/unit_distributed/test_domain_decompositions.py
@@ -209,7 +209,6 @@ class TestDomain_Decompositions_Distributed(unittest.TestCase):
     # 1 node with 1 cpu core, 1 gpu; assumes all cells will be placed on gpu in a single cell group
     @unittest.skipIf(not gpu_enabled, "GPU not enabled")
     def test_domain_decomposition_homogenous_GPU(self):
-
         if mpi_enabled:
             comm = arb.mpi_comm()
             context = arb.context(threads=1, gpu_id=0, mpi=comm)