from typing import Any


def verify_assign_and_read(obj: Any, attr: str, value: Any) -> Any:
    """
    Assign value to attribute, read and return result.

    Assert that values can be mutated and read before and after mutation.
    """
    try:
        setattr(obj, attr, value)
    except AttributeError:
        raise AssertionError(f"error mutating obj.{attr}")

    try:
        return getattr(obj, attr)
    except AttributeError:
        raise AssertionError(f"obj.{attr} does not exist even after assignment")