You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change the type of Extensions from Mapping to MutableMapping. #2794
Originally posted by karosis88 July 28, 2023
I'm working on a library that implements HTTP Caching for httpx and httpcore (it provides transports and connection pools), and I'd like to add an extension that simply indicates whether or not the response was taken from the cache.
Unfortunately, the type of extension is Mapping, so this is an error for mypy.
error: Unsupported target for indexed assignment ("Mapping[Str, Any]") [index]
The solution is to simply change the extension type from Mapping to MutableMapping, allowing us to add custom extensions after the response has been created.
Activity