Skip to content

LoroList.get returns ValueOrContainer #23

@syntonym

Description

@syntonym

LoroList.get and other functions that return objects inside Containers currently return ValueOrContainer. This means, that the following code is wrong:

l = LoroMap()
l.set("a", "a")
assert l.get("a") == "a"

instead, an additional access to value is required: assert l.get("a").value == "a". This is very surprising from a python view, where getting objects out of containers are expected to be the same object passed into the container.

I suggest always returning Value or Container directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions