Question : python immutable dataclass
Answered by : foolish-finch-ad47cn9z7k9d
# truly immutable Python objects are not possible,
# but it's simulated by throwing an exception if you want to set fields
from dataclasses import dataclass
@dataclass(frozen=True)
class MyImmutableData: immutable_field: str
Source : | Last Update : Mon, 06 Sep 21