from copy import copy from typing import Protocol, Self class Clonable[T = Self](Protocol): def clone(self) -> T: return copy(self)