Last active
March 9, 2025 09:06
-
-
Save mypy-play/8dfe8b142fba2e9ea948ea18a8c427db to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains 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 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