Skip to content

Instantly share code, notes, and snippets.

@tsibley
Created June 9, 2023 18:50
Show Gist options
  • Select an option

  • Save tsibley/1a5a8a6711068300ca87fd24260adae5 to your computer and use it in GitHub Desktop.

Select an option

Save tsibley/1a5a8a6711068300ca87fd24260adae5 to your computer and use it in GitHub Desktop.
from typing import MutableMapping, Mapping, Union
t = MutableMapping[str, Union[str, None]]
s = Mapping[str, Union[str, None]]
def f(x: t):
...
def g(x: s):
...
x = {
"foo": "bar",
}
reveal_type(x)
f(x)
g(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment