You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dataclass descriptors + conformance test problems #2065
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
changed the title [-]Dataclass descriptors conformance tests may block correctness[/-][+]Dataclass descriptors + conformance test problems[/+]on Jan 12, 2026
Self-assigned: I'm working on fixes to Pyrefly that seem to best approximate runtime behavior, I'll reach out to the typing repo once my fixes are in trunk because that will make sharing context easier
While working on the fix I realized there are more edge cases (data descriptors, self-assignable descriptors) where types potentially work out okay, but the conformance tests are still asserting what seems like wrong behavior to me.
This issue has someone assigned, but has not had recent activity for more than 2 weeks.
If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.
@stroxler I'm going through some of the conformance related issues and came across this one! is this still something you are working on and would you think it's a good idea to open it up to the community?
It's not suitable for a contributor who wants to hack on Pyrefly, it's a typing community problem because I think the existing conformance tests are wrong.
I'd be fine with someone else taking it on, but most of the people looking at our issues want to hack on Pyrefly, not propose changes that need to go through the typing council
Activity
[-]Dataclass descriptors conformance tests may block correctness[/-][+]Dataclass descriptors + conformance test problems[/+]stroxler commentedon Jan 12, 2026
Self-assigned: I'm working on fixes to Pyrefly that seem to best approximate runtime behavior, I'll reach out to the
typingrepo once my fixes are in trunk because that will make sharing context easierWhile working on the fix I realized there are more edge cases (data descriptors, self-assignable descriptors) where types potentially work out okay, but the conformance tests are still asserting what seems like wrong behavior to me.
github-actions commentedon Jan 29, 2026
This issue has someone assigned, but has not had recent activity for more than 2 weeks.
If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.
Thank you for your contributions!
migeed-z commentedon Feb 9, 2026
@stroxler I'm going through some of the conformance related issues and came across this one! is this still something you are working on and would you think it's a good idea to open it up to the community?
stroxler commentedon Feb 12, 2026
It's not suitable for a contributor who wants to hack on Pyrefly, it's a typing community problem because I think the existing conformance tests are wrong.
I'd be fine with someone else taking it on, but most of the people looking at our issues want to hack on Pyrefly, not propose changes that need to go through the typing council
Add github workflow for v1 issue ranking
Add github workflow for v1 issue ranking
yangdanny97 commentedon Aug 5, 2026
relevant issue/PR in the typing repo
python/typing#2259
python/typing#2299
Resolve descriptor `__get__` overloads for instance access
split dataclass descriptor soundness errors into separate error code,…
Resolve descriptor `__get__` overloads for instance access
split dataclass descriptor soundness errors into separate error code,…