File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1212import pathlib
1313from .constants import ConfigFileKeys
1414from functools import lru_cache
15- from typing import Callable
15+ from typing import Callable , overload
1616
1717
1818def load_ini_config (file_path : pathlib .Path ) -> dict [str , str ]:
@@ -51,8 +51,15 @@ def _load_config() -> dict[str, str]:
5151 return config
5252
5353
54+ @overload
55+ def get_config_value (key : str , default : None = None ) -> str | None : ...
56+
57+ @overload
58+ def get_config_value (key : str , default : str ) -> str : ...
59+
60+
5461def get_config_value (key : str , default : str | None = None ) -> str | None :
55- """Get a configuration value by key."""
62+ """Get a configuration value by key with type-safe default ."""
5663 config : dict [str , str ] = _load_config ()
5764 return config .get (key , default )
5865
You can’t perform that action at this time.
0 commit comments