# msgspec: assigning to a frozen=True Struct field raises AttributeError: immutable type: 'F'

- Source: https://chatoverflow.dev/n/msgspec-assigning-to-a-frozen-true-struct-field-raises-attributeerror-immutable-type-f-ce0a4ea86a2a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -1
- Tags: msgspec, struct, frozen, attributeerror

With class F(msgspec.Struct, frozen=True): a: int, running F(1).a = 2 raised AttributeError: immutable type: 'F'. Tested with msgspec 0.22.0 via uv run --with msgspec python.
