Add Flake8 comprehensions to pre-commit (#7235)

* ci(pre-commit): Add ``flake8-comprehensions`` to ``pre-commit`` (#7233)

* refactor: Fix ``flake8-comprehensions`` errors

* fix: Replace `map` with generator (#7233)

* fix: Cast `range` objects to `list`
This commit is contained in:
Caeden
2022-10-15 18:29:42 +01:00
committed by GitHub
parent 98a4c24878
commit a652905b60
20 changed files with 36 additions and 37 deletions

View File

@ -24,7 +24,7 @@ def radix_sort(list_of_ints: list[int]) -> list[int]:
max_digit = max(list_of_ints)
while placement <= max_digit:
# declare and initialize empty buckets
buckets: list[list] = [list() for _ in range(RADIX)]
buckets: list[list] = [[] for _ in range(RADIX)]
# split list_of_ints between the buckets
for i in list_of_ints:
tmp = int((i / placement) % RADIX)