Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created October 4, 2026 17:08
Show Gist options
  • Select an option

  • Save mypy-play/f8cffa8b2066434aa44562fd16797751 to your computer and use it in GitHub Desktop.

Select an option

Save mypy-play/f8cffa8b2066434aa44562fd16797751 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from typing import Optional
from typing import reveal_type
def bug_wrong(my_list: list[tuple[int, str, str]]) -> bool:
for _, *my_tuple in my_list:
reveal_type(my_tuple)
if my_tuple == ('foo', 'bar'):
return True
return False
def bug_right(my_list: list[tuple[int, str, str]]) -> bool:
for my_tuple in my_list:
reveal_type(my_tuple)
reveal_type(my_tuple[1:])
if my_tuple[1:] == ('foo', 'bar'):
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment