def METHOD_NAME(self, key: Any, list_: Any) -> Any:
    if isinstance(list_, tuple):
        list_ = list(list_)
    elif not isinstance(list_, list):
        list_ = [list_]
    for existing_version in self.getlist(key, []):
        # Dispose of any FakeKeys that we will not keep
        # We should only have FakeKeys here - but we're checking hasattr to be sure
        if existing_version not in list_ and hasattr(existing_version, "dispose"):
            existing_version.dispose()
    super().__setitem__(key, list_)