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 19:29:42 +02:00
committed by GitHub
parent 98a4c24878
commit a652905b60
20 changed files with 36 additions and 37 deletions
+1 -3
View File
@@ -70,9 +70,7 @@ class Automaton:
>>> A.search_in("whatever, err ... , wherever")
{'what': [0], 'hat': [1], 'ver': [5, 25], 'er': [6, 10, 22, 26]}
"""
result: dict = (
dict()
) # returns a dict with keywords and list of its occurrences
result: dict = {} # returns a dict with keywords and list of its occurrences
current_state = 0
for i in range(len(string)):
while (