10 lines
281 B
Python
10 lines
281 B
Python
from importlib import import_module
|
|
from typing import Any
|
|
|
|
|
|
def create_object(module_name: str, class_name: str, *args: list[Any], **kwargs: dict[Any, Any]) -> object:
|
|
module = import_module(module_name)
|
|
|
|
cls = getattr(module, class_name)
|
|
|
|
return cls(*args, **kwargs)
|