File size: 364 Bytes
246d201
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from types import ModuleType


def import_functions(

    module: ModuleType, function_names: list[str], target_globals: dict

) -> None:
    for name in function_names:
        if hasattr(module, name):
            target_globals[name] = getattr(module, name)
        else:
            raise ValueError(f'Function {name} not found in {module.__name__}')