[pre-commit.ci] pre-commit autoupdate (#12398)
updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.10...v0.5.0) - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f3f32ae3ca
commit
fc33c50593
@@ -24,7 +24,7 @@ import string
|
||||
from collections.abc import Generator, Iterable
|
||||
|
||||
|
||||
def chunker(seq: Iterable[str], size: int) -> Generator[tuple[str, ...], None, None]:
|
||||
def chunker(seq: Iterable[str], size: int) -> Generator[tuple[str, ...]]:
|
||||
it = iter(seq)
|
||||
while True:
|
||||
chunk = tuple(itertools.islice(it, size))
|
||||
|
||||
@@ -10,7 +10,7 @@ def remove_duplicates(key: str) -> str:
|
||||
|
||||
key_no_dups = ""
|
||||
for ch in key:
|
||||
if ch == " " or ch not in key_no_dups and ch.isalpha():
|
||||
if ch == " " or (ch not in key_no_dups and ch.isalpha()):
|
||||
key_no_dups += ch
|
||||
return key_no_dups
|
||||
|
||||
|
||||
@@ -52,10 +52,8 @@ def decrypt_message(key: int, message: str) -> str:
|
||||
plain_text[col] += symbol
|
||||
col += 1
|
||||
|
||||
if (
|
||||
(col == num_cols)
|
||||
or (col == num_cols - 1)
|
||||
and (row >= num_rows - num_shaded_boxes)
|
||||
if (col == num_cols) or (
|
||||
(col == num_cols - 1) and (row >= num_rows - num_shaded_boxes)
|
||||
):
|
||||
col = 0
|
||||
row += 1
|
||||
|
||||
Reference in New Issue
Block a user