Skip to content
Myr

Make Origin use scheme, not is_ssl (#168)

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

authored by Stephen Brown II · committed by Seth Michael Larson · parent 72e6f47 · Browse files · 3 files+6 added−6 removed
This commit

State

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

Diff stats

3 files+6 added−6 removed

  • other:+6 added−6 removed

3 files+6 added−6 removed

modified:docs/api.md+1 added
modified:httpx/dispatch/connection_pool.py+2 added-4 removed
24 unmodified lines
25 * Return the total number of connections.26 """2728 def __init__(self) -> None:29 self.all = {} # type: typing.Dict[HTTPConnection, float]30 self.by_origin = (31 {}32 ) # type: typing.Dict[Origin, typing.Dict[HTTPConnection, float]]29 self.all: typing.Dict[HTTPConnection, float] = {}30 self.by_origin: typing.Dict[Origin, typing.Dict[HTTPConnection, float]] = {}3132 def pop_by_origin(33 self, origin: Origin, http2_only: bool = False34 ) -> typing.Optional[HTTPConnection]:
129 unmodified lines
modified:httpx/models.py+3 added-2 removed
231 unmodified lines
232233 def __init__(self, url: URLTypes) -> None:234 if not isinstance(url, URL):235 url = URL(url)236 self.scheme = url.scheme237 self.is_ssl = url.is_ssl238 self.host = url.host239 self.port = url.port240241 def __eq__(self, other: typing.Any) -> bool:242 return (243 isinstance(other, self.__class__)243 and self.is_ssl == other.is_ssl244 and self.scheme == other.scheme245 and self.host == other.host246 and self.port == other.port247 )248249 def __hash__(self) -> int:249 return hash((self.is_ssl, self.host, self.port))250 return hash((self.scheme, self.host, self.port))251252253class QueryParams(typing.Mapping[str, str]):254 """
930 unmodified lines