Welp, found an example where ty, mypy, and pyright disagree, and where none of them appear to be quite correct?
```python
from typing import Any, Optional, cast, reveal_type
class Config:
values: dict[str, Any] = {}
def get[T](self, key: str) -> Optional[T]:
return cast(T, self.values[key])
config = Config()
foo = config.get("foo")
reveal_type(foo)
bar: dict[str, str] = config.get(key="bar") or {}
reveal_type(bar)
```