Why this matters
Protects shared configuration/state against accidental writes.
Expose constant dicts as read-only via MappingProxyType (or frozen dataclasses) to prevent runtime mutation.
Protects shared configuration/state against accidental writes.
Side-by-side examples engineers can pattern-match during review.
STATUS_MAP = {'ok': 200}
STATUS_MAP['fail'] = 500 # allowedfrom types import MappingProxyType
_STATUS_MAP = {'ok': 200, 'fail': 500}
STATUS_MAP = MappingProxyType(_STATUS_MAP)CONST = {'a': 1}; CONST['b']=2CONST = MappingProxyType({'a': 1})From the same buckets as this rule.