Skip to content

Commit

Permalink
Fix extensions type annotation. (#3380)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie authored Nov 28, 2024
1 parent ce7e14d commit a33c878
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions httpx/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def __init__(
self.method = method.upper()
self.url = URL(url) if params is None else URL(url, params=params)
self.headers = Headers(headers)
self.extensions = {} if extensions is None else extensions
self.extensions = {} if extensions is None else dict(extensions)

if cookies:
Cookies(cookies).set_cookie_header(self)
Expand Down Expand Up @@ -537,7 +537,7 @@ def __init__(
# the client will set `response.next_request`.
self.next_request: Request | None = None

self.extensions: ResponseExtensions = {} if extensions is None else extensions
self.extensions = {} if extensions is None else dict(extensions)
self.history = [] if history is None else list(history)

self.is_closed = False
Expand Down
5 changes: 2 additions & 3 deletions httpx/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
Iterator,
List,
Mapping,
MutableMapping,
Optional,
Sequence,
Tuple,
Expand Down Expand Up @@ -67,7 +66,7 @@

RequestContent = Union[str, bytes, Iterable[bytes], AsyncIterable[bytes]]
ResponseContent = Union[str, bytes, Iterable[bytes], AsyncIterable[bytes]]
ResponseExtensions = MutableMapping[str, Any]
ResponseExtensions = Mapping[str, Any]

RequestData = Mapping[str, Any]

Expand All @@ -84,7 +83,7 @@
]
RequestFiles = Union[Mapping[str, FileTypes], Sequence[Tuple[str, FileTypes]]]

RequestExtensions = MutableMapping[str, Any]
RequestExtensions = Mapping[str, Any]

__all__ = ["AsyncByteStream", "SyncByteStream"]

Expand Down

0 comments on commit a33c878

Please sign in to comment.