from typing import Sized, Protocol class SizedAndClosable(Sized, Protocol): def close(self) -> None: ...