Skip to content

Commit c26b61a

Browse files
committed
fix: correct docstrings in prime_numbers.py
The docstrings for slow_primes(), primes(), and fast_primes() incorrectly stated 'Return a list of all primes numbers up to max.' However, all three functions return a Generator[int], not a list. Also fixed the grammar: 'primes numbers' -> 'prime numbers'.
1 parent 678dedb commit c26b61a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

maths/prime_numbers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
def slow_primes(max_n: int) -> Generator[int]:
66
"""
7-
Return a list of all primes numbers up to max.
7+
Return a generator of all prime numbers up to max_n.
88
>>> list(slow_primes(0))
99
[]
1010
>>> list(slow_primes(-1))
@@ -31,7 +31,7 @@ def slow_primes(max_n: int) -> Generator[int]:
3131

3232
def primes(max_n: int) -> Generator[int]:
3333
"""
34-
Return a list of all primes numbers up to max.
34+
Return a generator of all prime numbers up to max_n.
3535
>>> list(primes(0))
3636
[]
3737
>>> list(primes(-1))
@@ -60,7 +60,7 @@ def primes(max_n: int) -> Generator[int]:
6060

6161
def fast_primes(max_n: int) -> Generator[int]:
6262
"""
63-
Return a list of all primes numbers up to max.
63+
Return a generator of all prime numbers up to max_n.
6464
>>> list(fast_primes(0))
6565
[]
6666
>>> list(fast_primes(-1))

0 commit comments

Comments
 (0)