Upgrade to flake8 v6 (#8007)

* Upgrade to flake8 v6

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss
2022-11-29 16:56:41 +01:00
committed by GitHub
parent f32d611689
commit 08c2245705
8 changed files with 16 additions and 13 deletions

View File

@ -32,7 +32,7 @@ def parse_file(file_path: str) -> list[Letter]:
if not c:
break
chars[c] = chars[c] + 1 if c in chars else 1
return sorted((Letter(c, f) for c, f in chars.items()), key=lambda l: l.freq)
return sorted((Letter(c, f) for c, f in chars.items()), key=lambda x: x.freq)
def build_tree(letters: list[Letter]) -> Letter | TreeNode:
@ -47,7 +47,7 @@ def build_tree(letters: list[Letter]) -> Letter | TreeNode:
total_freq = left.freq + right.freq
node = TreeNode(total_freq, left, right)
response.append(node)
response.sort(key=lambda l: l.freq)
response.sort(key=lambda x: x.freq)
return response[0]