Answers for "python immutable dataclass"

0

python immutable dataclass

# 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
Posted by: Guest on August-30-2021

Code answers related to "python immutable dataclass"

Python Answers by Framework

Browse Popular Code Answers by Language