Skip to content

Commit

Permalink
make sieve2-s.py work with mypy
Browse files Browse the repository at this point in the history
The numbers variable needs to be typed with Iteractor[int] to fix a typing error from the change in python/typeshed#5145 .

See python/mypy#17414 and python/typeshed#5145 .
  • Loading branch information
chrisirhc committed Jun 30, 2024
1 parent 77deba4 commit 76ae50f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo/sieve2-s.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
def iter_primes||() -> Iterator[int]||:
# An iterator of all numbers between 2 and
# +infinity
numbers = itertools.count(2)
numbers: Iterator[int] = itertools.count(2)

# Generate primes forever
while True:
Expand Down

0 comments on commit 76ae50f

Please sign in to comment.