@@ -393,7 +393,7 @@ class Config:
393393
394394 def __init__ (
395395 self ,
396- cfg_dict : dict = None ,
396+ cfg_dict : Optional [ dict ] = None ,
397397 cfg_text : Optional [str ] = None ,
398398 filename : Optional [Union [str , Path ]] = None ,
399399 env_variables : Optional [dict ] = None ,
@@ -1227,7 +1227,8 @@ def is_base_line(c):
12271227 if base_code is not None :
12281228 base_code = ast .Expression ( # type: ignore
12291229 body = base_code .value ) # type: ignore
1230- base_files = eval (compile (base_code , '' , mode = 'eval' ))
1230+ base_files = eval (compile (base_code , '' ,
1231+ mode = 'eval' )) # type: ignore
12311232 else :
12321233 base_files = []
12331234 elif file_format in ('.yml' , '.yaml' , '.json' ):
@@ -1288,7 +1289,7 @@ def _get_cfg_path(cfg_path: str,
12881289 def _merge_a_into_b (a : dict ,
12891290 b : dict ,
12901291 allow_list_keys : bool = False ) -> dict :
1291- """merge dict ``a`` into dict ``b`` (non-inplace).
1292+ """Merge dict ``a`` into dict ``b`` (non-inplace).
12921293
12931294 Values in ``a`` will overwrite ``b``. ``b`` is copied first to avoid
12941295 in-place modifications.
@@ -1358,22 +1359,22 @@ def auto_argparser(description=None):
13581359
13591360 @property
13601361 def filename (self ) -> str :
1361- """get file name of config."""
1362+ """Get file name of config."""
13621363 return self ._filename
13631364
13641365 @property
13651366 def text (self ) -> str :
1366- """get config text."""
1367+ """Get config text."""
13671368 return self ._text
13681369
13691370 @property
13701371 def env_variables (self ) -> dict :
1371- """get used environment variables."""
1372+ """Get used environment variables."""
13721373 return self ._env_variables
13731374
13741375 @property
13751376 def pretty_text (self ) -> str :
1376- """get formatted python config text."""
1377+ """Get formatted python config text."""
13771378
13781379 indent = 4
13791380
@@ -1727,17 +1728,17 @@ def to_dict(self, keep_imported: bool = False):
17271728
17281729
17291730class DictAction (Action ):
1730- """
1731- argparse action to split an argument into KEY=VALUE form
1732- on the first = and append to a dictionary. List options can
1733- be passed as comma separated values, i.e 'KEY=V1,V2,V3', or with explicit
1734- brackets, i.e. 'KEY=[V1,V2,V3]'. It also support nested brackets to build
1735- list/tuple values. e.g. 'KEY=[(V1,V2),(V3,V4)]'
1731+ """Argparse action to split an argument into KEY=VALUE form on the first =
1732+ and append to a dictionary.
1733+
1734+ List options can be passed as comma separated values, i.e 'KEY=V1,V2,V3',
1735+ or with explicit brackets, i.e. 'KEY=[V1,V2,V3]'. It also support nested
1736+ brackets to build list/tuple values. e.g. 'KEY=[(V1,V2),(V3,V4)]'
17361737 """
17371738
17381739 @staticmethod
17391740 def _parse_int_float_bool (val : str ) -> Union [int , float , bool , Any ]:
1740- """parse int/float/bool value in the string."""
1741+ """Parse int/float/bool value in the string."""
17411742 try :
17421743 return int (val )
17431744 except ValueError :
@@ -1822,7 +1823,7 @@ def __call__(self,
18221823 parser : ArgumentParser ,
18231824 namespace : Namespace ,
18241825 values : Union [str , Sequence [Any ], None ],
1825- option_string : str = None ):
1826+ option_string : str = None ): # type: ignore
18261827 """Parse Variables in string and add them into argparser.
18271828
18281829 Args:
0 commit comments