starlette
starlette copied to clipboard
Add `ContentType` generic to `Response`
- Retry of https://github.com/encode/starlette/pull/1534.
At the time that PR was implemented the default= parameter was not available on TypeVar, and mypy didn't support it.
Now it's possible to achieve what that PR intended.
I think JsonResponse and others don’t actually accept Any, they accept a limited set of types. Is that codified in this PR? If it is I’m missing it.
You are right, but I'm not changing that in this PR. And I think there was an attempt to change the type, but it failed, and we had to revert.