Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created November 11, 2025 13:49
Show Gist options
  • Save mypy-play/6b9f22e6fc9b976122326ce980ac9b7c to your computer and use it in GitHub Desktop.
Save mypy-play/6b9f22e6fc9b976122326ce980ac9b7c to your computer and use it in GitHub Desktop.
Shared via mypy Playground
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