|     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Verified Commit 9b1dd329 authored by Emi Simpson's avatar Emi Simpson
Browse files

[new arch] Make _fold_sources a tiny bit more generic

parent a57f5e90
Pipeline #871 passed with stage
in 59 seconds
......@@ -7,14 +7,14 @@ from mystic.sources import Source, SOURCE_PROCESSORS
from mystic import queries, outcome
from functools import reduce
from typing import Callable, cast, Collection, List, Mapping, Tuple, TypeAlias
from typing import Callable, cast, Collection, Iterable, List, Mapping, Tuple, TypeAlias
Action: TypeAlias = Callable[[Request], Outcomes | Query[Outcomes, Outcomes]]
AuthedProjectAction: TypeAlias = Callable[[Request, UncheckedPID, UserID], Outcomes | Query[Outcomes, Outcomes]]
force_login: Tuple[outcome.ForceLogin] = (outcome.ForceLogin(),)
def _fold_sources(sources: List[Source]) -> Mapping[Backend, Collection[Url]]:
def _fold_sources(sources: Iterable[Source]) -> Mapping[Backend, Collection[Url]]:
return reduce(
lambda dict, source:
dict | {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment