This is interesting.
Previously I’ve just had my dataclass-like slotting tool add __dict__ in the case where it found a @cached_property in order to just make them work. For whatever reason I didn’t think you could replace the slot attribute in a class.
It seems like wrapping the function and slot together can make for a fairly simple descriptor that can be used to replace a cached_property on the class[1]. The requirement being that it’s linked with a metaclass or class-rebuilder[2] that can remove the original object so the slot can be placed before replacing the slot descriptor with the wrapper. For dataclasses to support something like this the logic would probably need to be in the _add_slots function.