def METHOD_NAME(self, obj: List, level: int, types: Set[Type]):
    if not obj:
        yield str(obj)
        return
    next_level = level + 1
    yield "[\n"
    for val in obj:
        yield spaces * next_level
        yield from self.write_object(val, next_level, types)
        yield ",\n"
    yield f"{spaces * level}]"