Skip to content
Myr

Updating docstrings

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 891548e · Browse files · 3 files+52 added−14 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+52 added−14 removed

  • other:+52 added−14 removed

3 files+52 added−14 removed

modified:httpcore/decoders.py+6 added-3 removed
21 unmodified lines
22 raise NotImplementedError() # pragma: nocover232425class IdentityDecoder(Decoder):26 """27 Handle unencoded data.28 """2930 def decode(self, data: bytes) -> bytes:31 return data3233 def flush(self) -> bytes:
49 unmodified lines
83class BrotliDecoder(Decoder):84 """85 Handle 'brotli' decoding.8683 Requires `pip install brotlipy`.84 See: https://brotlipy.readthedocs.io/87 Requires `pip install brotlipy`. See: https://brotlipy.readthedocs.io/88 """8990 def __init__(self) -> None:91 assert (
21 unmodified lines
113 """114115 def __init__(self, children: typing.Sequence[Decoder]) -> None:116 """114 children should be a sequence of decoders in the order in which117 'children' should be a sequence of decoders in the order in which118 each was applied.119 """120 # Note that we reverse the order for decoding.121 self.children = list(reversed(children))
28 unmodified lines
modified:httpcore/exceptions.py+20 added-11 removed
38 unmodified lines
39 Malformed HTTP.40 """414243class DecodingError(Exception):44 """45 Decoding of the response failed.46 """474849# Redirect exceptions...505152class RedirectError(Exception):
20 unmodified lines
73 Infinite redirect loop.74 """757671# Response exceptions...77# Stream exceptions...787974class StreamConsumed(Exception):80class StreamException(Exception):81 """82 The base class for stream exceptions.8384 The developer made an error in accessing the request stream in85 an invalid way.86 """878889class StreamConsumed(StreamException):90 """91 Attempted to read or stream response content, but the content has already92 been streamed.93 """949581class ResponseNotRead(Exception):96class ResponseNotRead(StreamException):97 """98 Attempted to access response content, without having called `read()`99 after a streaming response.100 """10110288class ResponseClosed(Exception):103class ResponseClosed(StreamException):104 """105 Attempted to read or stream response content, but the request has been91 closed without loading the body.106 closed.107 """10810995class DecodingError(Exception):96 """97 Decoding of the response failed.98 """99100110# Other cases...111112113class InvalidURL(Exception):
3 unmodified lines
modified:httpcore/interfaces.py+26 added
6 unmodified lines
7OptionalTimeout = typing.Optional[TimeoutConfig]8910class Adapter:11 """12 The base class for all adapter or dispatcher classes.1314 Stubs out the interface, as well as providing a `.request()` convienence15 implementation, to make it easy to use or test stand-alone adapters,16 without requiring a complete `Client` instance.17 """1819 async def request(20 self,21 method: str,22 url: URLTypes,
28 unmodified lines
51 await self.close()525354class BaseReader:55 """56 A stream reader. Abstracts away any asyncio-specfic interfaces57 into a more generic base class, that we can use with alternate58 backend, or for stand-alone test cases.59 """6061 async def read(self, n: int, timeout: OptionalTimeout = None) -> bytes:62 raise NotImplementedError() # pragma: no cover636465class BaseWriter:66 """67 A stream writer. Abstracts away any asyncio-specfic interfaces68 into a more generic base class, that we can use with alternate69 backend, or for stand-alone test cases.70 """7172 def write_no_block(self, data: bytes) -> None:73 raise NotImplementedError() # pragma: no cover7475 async def write(self, data: bytes, timeout: OptionalTimeout = None) -> None:
3 unmodified lines
79 raise NotImplementedError() # pragma: no cover808182class BasePoolSemaphore:83 """84 A semaphore for use with connection pooling.8586 Abstracts away any asyncio-specfic interfaces.87 """8889 async def acquire(self) -> None:90 raise NotImplementedError() # pragma: no cover9192 def release(self) -> None:
1 unmodified line