From: Luke Kenneth Casson Leighton Date: Thu, 18 Aug 2022 09:43:11 +0000 (+0100) Subject: i really hate f"....". replace with just bin(v) and add a comment X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f708613dddc67e6d39df960db998626435757b0d;p=nmutil.git i really hate f"....". replace with just bin(v) and add a comment --- diff --git a/src/nmutil/test/test_prefix_sum.py b/src/nmutil/test/test_prefix_sum.py index cef9da1..48598b8 100644 --- a/src/nmutil/test/test_prefix_sum.py +++ b/src/nmutil/test/test_prefix_sum.py @@ -70,7 +70,7 @@ class TestPrefixSum(FHDLTestCase): def tst_pop_count_int(self, width): assert isinstance(width, int) for v in range(1 << width): - expected = f"{v:b}".count("1") + expected = bin(v).count("1") # converts to a string, counts 1s with self.subTest(v=v, expected=expected): self.assertEqual(expected, pop_count(v, width=width))