bundles / papyri 0.0.10 / papyri / examples / async_fetch
function
papyri.examples:async_fetch
source: /papyri/examples.py :517
Signature
async def async_fetch ( url : str , * , timeout : float = 10.0 ) → bytes Summary
Pretend to fetch url and return its body.
Extended Summary
A minimal async def coroutine function used to exercise papyri's handling of coroutine function signatures. The body does no I/O so the example stays side-effect free at import time.
Of course timeout does nothing
Parameters
url: strTarget URL. The value is ignored in this example.
timeout: float, keyword-only, optionalDeadline in seconds. Defaults to
10.0.
Returns
: bytesA fixed, deterministic response body.
See also
- async_counter
An
async defgenerator function (hasyield).- example1
Another async example, with a more elaborate signature.
- simple_generator
The synchronous generator counterpart.
Aliases
-
papyri.examples.async_fetch