Skip to content
Myr

Improve class __repr__

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by Tom Christie · parent 6165459 · Browse files · 1 file+6 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−2 removed

  • other:+6 added−2 removed

1 file+6 added−2 removed

modified:httpcore/models.py+6 added-2 removed
196 unmodified lines
197 return hash((self.is_ssl, self.host, self.port))198199200class QueryParams(typing.Mapping):201 """202 URL query parameters, as a multi-dict.203 """204205 def __init__(self, *args: QueryParamTypes, **kwargs: typing.Any) -> None:206 assert len(args) < 2, "Too many arguments."207 assert not (args and kwargs), "Cannot mix named and unnamed arguments."208
311 unmodified lines
520521 def __repr__(self) -> str:522 class_name = self.__class__.__name__523 url = str(self.url)520 return f"<{class_name}({self.method}, {url})>"524 return f"<{class_name}({self.method!r}, {url!r})>"525526527class Response:528 def __init__(
194 unmodified lines
723 )724725 def __repr__(self) -> str:726 class_name = self.__class__.__name__723 return f"<{class_name}(status_code={self.status_code})>"727 return f"<{class_name}({self.status_code}, {self.reason_phrase!r})>"728729 def raise_for_status(self) -> None:730 """731 Raise the `HttpError` if one occurred.
15 unmodified lines