def __copy__(self):
        result = type(self)(self.widget)
        result.state = copy(self.state)

        # share public attributes
        for k, v in self.__dict__.items():
            if not k.startswith('_'):
                result.__dict__[k] = v

        # copy settings
        for k in self._settings:
            result._settings[k] = copy(self._settings[k])

        return result
Copying a CustomViewer freezes custom settings at their current value,
dataset/ETHPy150Open glue-viz/glue/glue/viewers/custom/qt/custom_viewer.py/CustomViewer.__copy__