from itertools import islice
from typing import Any, Callable, Dict, Iterator, Tuple
+
def init_or_inc(
d: Dict[Any, Any],
key: Any,
def coalesce(
inputs: Iterator[Dict[Any, Any]],
*,
- aggregation_function: Callable[[Any, Any, Any], Any] = coalesce_by_creating_list
+ aggregation_function: Callable[[Any, Any], Any] = coalesce_by_creating_list
) -> Dict[Any, Any]:
- out = {}
+ out: Dict[Any, Any] = {}
for d in inputs:
for key in d:
if key in out: