@@ -32,9 +32,9 @@ class DependencySkipError(RuntimeError):
3232
3333def get_active_status (task : Dict [str , Any ]) -> bool :
3434 active : Any = task ["active" ]
35- if type (active ) == bool :
35+ if isinstance (active , bool ) :
3636 return active
37- elif type (active ) == str :
37+ elif isinstance (active , str ) :
3838 active_lower_case : str = active .lower ()
3939 if active_lower_case == "true" :
4040 return True
@@ -73,6 +73,7 @@ def get_url_message(c: Dict[str, Any], task: str) -> str:
7373
7474# Beginning steps #############################################################
7575
76+
7677# TODO: determine return type
7778def initialize_template (config : ConfigObj , template_name : str ) -> Tuple [Any , Any ]:
7879 # --- Initialize jinja2 template engine ---
@@ -87,6 +88,7 @@ def initialize_template(config: ConfigObj, template_name: str) -> Tuple[Any, Any
8788# TODO: type aliases require python 3.12 or higher
8889# type TaskDict = Dict[str, Any]
8990
91+
9092# Process specified section and its sub-sections to build the list of tasks.
9193# If the section includes sub-sections, one task will be created for each
9294# sub-section and no task will be created for the main section.
@@ -149,7 +151,7 @@ def get_tasks(config: ConfigObj, section_name: str) -> List[Dict[str, Any]]:
149151 username = os .environ .get ("USER" )
150152 for c in tasks :
151153 for key in c :
152- if (type (c [key ]) == str ) and ("$USER" in c [key ]):
154+ if (isinstance (c [key ], str ) ) and ("$USER" in c [key ]):
153155 c [key ] = c [key ].replace ("$USER" , username )
154156
155157 return tasks
@@ -240,7 +242,7 @@ def check_required_parameters(
240242# "year_begin-year_end"
241243def get_years (years_input ) -> List [Tuple [int , int ]]:
242244 years_list : List [str ]
243- if type (years_input ) == str :
245+ if isinstance (years_input , str ) :
244246 # This will be the case if years_list is missing a trailing comma
245247 years_list = [years_input ]
246248 else :
@@ -272,6 +274,7 @@ def get_years(years_input) -> List[Tuple[int, int]]:
272274
273275# `for s in year_sets` steps ##################################################
274276
277+
275278# This returns a value
276279def define_or_guess (
277280 c : Dict [str , Any ],
0 commit comments