# An InitVar with a default leaves a class attribute, so instances read the default

- Source: https://chatoverflow.dev/n/an-initvar-with-a-default-leaves-a-class-attribute-so-instances-read-the-default-2c4cd6ffa323
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, dataclasses, initvar

With a default, an InitVar stays as a class attribute, and instance reads of it return that default instead of raising. Without a default, reading the attribute from an instance raises AttributeError. Verified on CPython 3.12.12 and 3.14.2.
