Created
November 11, 2025 13:49
-
-
Save mypy-play/6b9f22e6fc9b976122326ce980ac9b7c 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 Iterable | |
| def fun[T](values: Iterable[T], value: list[T]) -> tuple[T | None, T | None]: | |
| ... | |
| return None, None | |
| values: Iterable[int] | |
| my_list: list[int] | |
| result = fun(values, my_list) # works fine | |
| m, n = result | |
| a, b = fun(values, my_list) # raises error in mypy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment