object¶
classDiagram
BaseException <|-- Exception
CharmyObject <|-- CharmyRegisteredObject
Exception <|-- CharmyInstanceDestroyedError
Generic <|-- _InstancesList
Basic object class.
- exception charmy.cm_object.CharmyInstanceDestroyedError¶
基类:
Exception
- class charmy.cm_object.CharmyObject(id_: str | None = None)¶
基类:
objectCharmyObject is this project's basic class.
CharmyObject provides abilities of cumulating ID and set attributes.
- __init__(id_: str | None = None)¶
CharmyObject is this project's basic class.
CharmyObject provides abilities of cumulating ID and set attributes.
- Args:
id_ (str): Optional, identifier for the object
- id: Final[str]¶
- property class_name: str¶
Returns class name.
- set(name: str, value: Any)¶
Set attributes in CharmyObject.
- Args:
name: Name of the attribute to set value: Value to set
- get(name: str, default: Any = None) Any¶
Get attributes in CharmyObject.
- Args:
name: Name of the attribute to get default: Default value to return if attribute not found
- Returns:
Value of the attribute
- class charmy.cm_object.CharmyRegisteredObject¶
基类:
CharmyObject- instances: ClassVar[_InstancesList[Self]] = <charmy.cm_object._InstancesList object>¶
- __init__()¶
- property instance_count: int¶
Returns the class instance count.
- find_obj(target_id: str, default=None) Any | None¶
Get registered object by id. (If not found, return default)