Skip to content

Rework casting mechanics #52

@simontaurus

Description

@simontaurus

Current state:
robotController = robotModel.cast(RobotController, args)

Wish:
robotController = RobotController(robotModel, args..)
the would require to override the __init__ to accept another base model that is converted to a dict that is de-packed to the actual contructor
__init__(Union[BaseModel, kwargs])

see also: https://stackoverflow.com/questions/71895185/convert-derived-class-to-base-class-in-python/77446717#77446717

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions