Skip to content

Commit 63100de

Browse files
committed
[mypy] fix type annotations for project euler problem008/sol2
1 parent ce8598f commit 63100de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

project_euler/problem_008/sol2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ def solution(n: str = N) -> int:
7070
"""
7171

7272
return max(
73-
reduce(lambda x, y: int(x) * int(y), n[i : i + 13]) for i in range(len(n) - 12)
73+
# mypy cannot properly interpret reduce
74+
int(reduce(lambda x, y: str(int(x) * int(y)), n[i : i + 13]))
75+
for i in range(len(n) - 12)
7476
)
7577

7678

0 commit comments

Comments
 (0)