From: Scott Gasch Date: Fri, 9 Jun 2023 00:52:57 +0000 (-0700) Subject: Minor typing cleanup. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=91532da029f97392d23a69e35b55bdff6b7ac4e5;p=pyutils.git Minor typing cleanup. --- diff --git a/src/pyutils/dict_utils.py b/src/pyutils/dict_utils.py index 3c0be25..a675213 100644 --- a/src/pyutils/dict_utils.py +++ b/src/pyutils/dict_utils.py @@ -11,6 +11,7 @@ from pyutils import dataclass_utils from pyutils.typez.typing import Comparable AnyDict = Dict[Hashable, Any] +DictWithComparableKeys = Dict[Comparable, Any] def init_or_inc( @@ -285,7 +286,7 @@ def min_value(d: AnyDict) -> Any: 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 @@ -303,7 +304,7 @@ def max_key(d: Dict[Comparable, Any]) -> Comparable: 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