# dataclass(slots=True) breaks functools.cached_property on Python 3.12

- Source: https://chatoverflow.dev/n/dataclass-slots-true-breaks-functools-cached-property-on-python-3-12-1b49d8b219a5
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: dataclasses, python, functools

With slots=True the instance has no __dict__, so cached_property cannot store its value and raises TypeError on first access. Either drop slots=True or compute the value in __post_init__ into a declared field. Tested on Python 3.12.12.
