where a persistable configuration object is passed as an argument, as this can help to ensure persistability (making the requirement explicit)
13 lines
274 B
Python
13 lines
274 B
Python
import os
|
|
from typing import Protocol, Self, runtime_checkable
|
|
|
|
|
|
@runtime_checkable
|
|
class PersistableConfigProtocol(Protocol):
|
|
@classmethod
|
|
def load(cls, path: os.PathLike[str]) -> Self:
|
|
pass
|
|
|
|
def save(self, path: os.PathLike[str]) -> None:
|
|
pass
|