Open this example in the interactive library
Source code
from dataclasses import dataclass
@dataclass(frozen=True)
class Config:
theme: str = 'dark'
print(Config())Sample output
Config(theme='dark')

Use an immutable dataclass. A self-contained example using the Python standard library.
Open this example in the interactive library
from dataclasses import dataclass
@dataclass(frozen=True)
class Config:
theme: str = 'dark'
print(Config())Config(theme='dark')