Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Last active March 9, 2025 09:06
Show Gist options
  • Save mypy-play/8dfe8b142fba2e9ea948ea18a8c427db to your computer and use it in GitHub Desktop.
Save mypy-play/8dfe8b142fba2e9ea948ea18a8c427db to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from typing import TypedDict, Mapping
class FooType(TypedDict):
a: int
b: str
def foo(value: Mapping[str, int | str]):
print(value)
x = {
"a": 1,
"b": "v",
}
foo(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment