typeddicts_readonly error

Mutation of ReadOnly TypedDict fields

Fields marked as ReadOnly in TypedDicts cannot be mutated through: - Direct assignment: td"key" = value - .update() calls

from typing import TypedDict
from typing_extensions import ReadOnly

class Config(TypedDict):
    name: str
    version: ReadOnly[str]

cfg: Config = {"name": "test", "version": "1.0"}
cfg["version"] = "2.0"  # E0056
cfg.update(version="2.0")  # E0056

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial typeddicts_readonly down per-file or per-path from your editor or pyproject.toml, or fix the code so it type-checks. See the Type System rules and the complete diagnostic reference.

Canonical URL: https://www.basilisk-python.dev/errors/typeddicts_readonly