Describe the Bug
This issue tracks an interaction between Pyrefly descriptor behavior and the conformance suite.
See this sandbox example, which is adapted from dataclasses_descriptors.py.
The actual behavior doesn't match what the conformance tests expect almost at all: I think that for a dataclass that has a descriptor with no __set__, instances will frequently wind up with raw descriptors as instance attributes although in the presence of optionality I suspect the behavior is unpredictable and you get a union at runtime.
If the descriptor does have a __set__, I'm highly uncertain the runtime behavior; likely the constructor winds up invoking it but I have not yet checked.
In addition, if no value is defined at all and the attribute is annotation only, then it's a pure instance-only attribute and no descriptor behavior exists (this would be true even for a normal class, it's not dataclass-specific) so the conformance tests are 100% wrong here.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
This issue tracks an interaction between Pyrefly descriptor behavior and the conformance suite.
See this sandbox example, which is adapted from
dataclasses_descriptors.py.The actual behavior doesn't match what the conformance tests expect almost at all: I think that for a dataclass that has a descriptor with no
__set__, instances will frequently wind up with raw descriptors as instance attributes although in the presence of optionality I suspect the behavior is unpredictable and you get a union at runtime.If the descriptor does have a
__set__, I'm highly uncertain the runtime behavior; likely the constructor winds up invoking it but I have not yet checked.In addition, if no value is defined at all and the attribute is annotation only, then it's a pure instance-only attribute and no descriptor behavior exists (this would be true even for a normal class, it's not dataclass-specific) so the conformance tests are 100% wrong here.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response