I\'m trying to create a frozen dataclass but I\'m having issues with setting a value from __post_init__. Is there a way to set a field value based on values from an
__post_init__
Use the same thing the generated __init__ method does: object.__setattr__.
object.__setattr__
def __post_init__(self): object.__setattr__(self, 'value', RANKS.index(self.rank) + 1)