From f708613dddc67e6d39df960db998626435757b0d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 18 Aug 2022 10:43:11 +0100 Subject: [PATCH] i really hate f"....". replace with just bin(v) and add a comment --- src/nmutil/test/test_prefix_sum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- 2.30.2