from pyutils.typez.typing import Comparable
AnyDict = Dict[Hashable, Any]
+DictWithComparableKeys = Dict[Comparable, Any]
def init_or_inc(
return item_with_min_value(d)[1]
-def max_key(d: Dict[Comparable, Any]) -> Comparable:
+def max_key(d: DictWithComparableKeys) -> Comparable:
"""
Args:
d: a dict with comparable keys
return max(d.keys())
-def min_key(d: Dict[Comparable, Any]) -> Comparable:
+def min_key(d: DictWithComparableKeys) -> Comparable:
"""
Args:
d: a dict with comparable keys