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

@ -28,8 +28,8 @@ def solution():
with open(triangle) as f:
triangle = f.readlines()
a = map(lambda x: x.rstrip("\r\n").split(" "), triangle)
a = list(map(lambda x: list(map(int, x)), a))
a = (x.rstrip("\r\n").split(" ") for x in triangle)
a = [list(map(int, x)) for x in a]
for i in range(1, len(a)):
for j in range(len(a[i])):