BaseObject: allow keyword arguments

This commit is contained in:
Aleix Conchillo Flaqué
2025-08-20 15:03:21 -07:00
parent 1377dec01b
commit 4ff0567025

View File

@@ -29,12 +29,13 @@ class BaseObject(ABC):
classes in the framework should inherit from this base class. classes in the framework should inherit from this base class.
""" """
def __init__(self, *, name: Optional[str] = None): def __init__(self, *, name: Optional[str] = None, **kwargs):
"""Initialize the base object. """Initialize the base object.
Args: Args:
name: Optional custom name for the object. If not provided, name: Optional custom name for the object. If not provided,
generates a name using the class name and instance count. generates a name using the class name and instance count.
**kwargs: Additional arguments passed to parent class.
""" """
self._id: int = obj_id() self._id: int = obj_id()
self._name = name or f"{self.__class__.__name__}#{obj_count(self)}" self._name = name or f"{self.__class__.__name__}#{obj_count(self)}"