Skip to content

conformance: delete questionable portions of dataclasses_descriptors test - #2388

Merged
jorenham merged 2 commits into
python:mainfrom
rchen152:dataclass_descriptors
Nov 13, 2026
Merged

jorenham merged 2 commits into
python:mainfrom
rchen152:dataclass_descriptors

Conversation

@rchen152

@rchen152 rchen152 commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Parts of the dataclasses_descriptors.py conformance test expect behavior that doesn't align with the runtime (see issue: #2259, PR: #2299). This PR deletes the questionable parts: Desc2, DC2, and the associated assert_types.

@carljm

carljm commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Sorry, I don't think this change makes sense :/ A good argument can be made that the current type expectation a few lines down is currently incorrect (at least for the code exactly as shown), but that doesn't clearly justify an error on this line. I don't think there is a good general rationale for making all non-data descriptors error if used as dataclass field defaults. So I think this just makes an already-confusing part of the conformance suite even more confusing.

If the goal is to weaken the conformance suite so Pyrefly isn't marked down for its behavior in an area where the suite isn't clearly correct anyway, I think we should just do that by deleting this DC2 section of the suite instead. I don't feel like that should be controversial (I would happily approve it). It doesn't preclude us reintroducing more tests in this area in future if someone is motivated to add them, but that clearly will require some significant work on proposing behavior and building consensus around it.

(In other words, if someone feels strongly that the conformance suite should specify the behavior of descriptors as dataclass defaults, I think they should feel free to work on that topic, but in the meantime they should not stand in the way of deleting the current clearly-inadequate conformance test.)

@rchen152 rchen152 changed the title conformance: allow error on using a non-data descriptor as a dataclass field's default value conformance: delete questionable portions of dataclasses_descriptors test Nov 13, 2026
@rchen152

Copy link
Copy Markdown
Collaborator Author

@carljm Done! The PR just deletes the DC2 section now.

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to do this too, agree with just deleting the questionable tests.

@jorenham
jorenham merged commit 6d2f52c into python:main Nov 13, 2026
5 checks passed
@jorenham

Copy link
Copy Markdown
Collaborator

Thanks Rebecca

@rchen152
rchen152 deleted the dataclass_descriptors branch November 13, 2026 21:11
@rchen152

Copy link
Copy Markdown
Collaborator Author

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants