From: Scott Gasch Date: Thu, 18 Aug 2022 06:41:48 +0000 (-0700) Subject: More new config bugs: needs to support a .get() method... doh. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=a993e44371ada4ae0c592058bd98f1c61342c04f;p=python_utils.git More new config bugs: needs to support a .get() method... doh. --- diff --git a/config.py b/config.py index a83433c..c883a3b 100644 --- a/config.py +++ b/config.py @@ -234,6 +234,9 @@ class Config: def __contains__(self, key: str) -> bool: return key in self.config + def get(self, key: str, default: Any = None) -> Optional[Any]: + return self.config.get(key, default) + @staticmethod def add_commandline_args(title: str, description: str = "") -> argparse._ArgumentGroup: """Create a new context for arguments and return a handle.