update frozen post-init example to use frozen (#1367)

This commit is contained in:
Douglas Griffith 2024-10-29 10:34:22 -04:00 committed by GitHub
parent 1921da6eac
commit 4580a74fc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -476,7 +476,7 @@ attrs.exceptions.FrozenInstanceError: can't set attribute
If you need to set attributes on a frozen class, you'll have to resort to the [same trick](how-frozen) as *attrs* and use {meth}`object.__setattr__`: If you need to set attributes on a frozen class, you'll have to resort to the [same trick](how-frozen) as *attrs* and use {meth}`object.__setattr__`:
```{doctest} ```{doctest}
>>> @define >>> @frozen
... class Frozen: ... class Frozen:
... x: int ... x: int
... y: int = field(init=False) ... y: int = field(init=False)