Skip to content

Commit 5ea6331

Browse files
committed
Add type hits and fix return type for prime generator
1 parent 31d63a1 commit 5ea6331

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ciphers/sha256.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"""
2020

2121
import math
22+
from collections.abc import Iterator
2223
from itertools import count, islice
2324

2425
# =============================================================================
@@ -232,7 +233,7 @@ def is_prime(num_to_test: int) -> bool:
232233
return all(num_to_test % f != 0 for f in range(2, math.isqrt(num_to_test) + 1))
233234

234235

235-
def first_n_primes(count_primes: int) -> list[int]:
236+
def first_n_primes(count_primes: int) -> Iterator[int]:
236237
"""
237238
Generates the first n prime numbers using itertools.count and a primality test.
238239
Examples:

0 commit comments

Comments
 (0)