Created
October 4, 2026 17:08
-
-
Save mypy-play/f8cffa8b2066434aa44562fd16797751 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 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