Created
May 14, 2026 17:59
-
-
Save mypy-play/0c8d2852ccb3424e715ae4136a036215 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Iterato | |
| def fib(n: int) -> Iterator[int]: | |
| a, b = 0, 1 | |
| while a < n: | |
| yield a | |
| a, b = b, a + b | |
| fib(10) | |
| fib(11) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment