Created
September 2, 2026 03:16
-
-
Save mypy-play/e911f6051028225c0fadd5434d87ff18 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 Any | |
| def do_something_awesome(thing: list[str | dict[Any, Any]]): | |
| ... | |
| only_list_str: list[str] = ["foo", "bar"] | |
| list_mixed: list[str, dict[Any, Any]] = ["foo", {"bar": "baz"}] | |
| do_something_awesome(["foo", "bar"]) | |
| do_something_awesome(["foo"]+["bar"]) | |
| do_something_awesome(only_list_str) | |
| do_something_awesome(list_mixed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment