Skip to content

Removed mandatory enforcement of a dataclass check #2022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erictraut
Copy link
Collaborator

Removed mandatory enforcement of "default value type of list, dict, or set" for dataclass fields in the dataclasses_inheritance test. This error is now optional for type checkers.

The typing spec doesn't mandate such a rule. This particular test in the conformance suite was based on a part of PEP 557 that was not officially incorporated into the typing spec, so it's questionable whether it belongs in the conformance suite in the first place. None of the major type checkers currently implement this check. I tried implementing it in pyright, and it creates a bunch of false positives for libraries like pydantic and attrs that use dataclass_transform and don't have this same limitation. See this thread for more details.

Also fixed the conformance summary for pyright in the aliases_typealiastype test, which was out of date and didn't reflect the fact that pyright now passes this test.

…r set" for dataclass fields in the `dataclasses_inheritance` test. This error is now optional for type checkers.

Also fixed the conformance summary for pyright in the `aliases_typealiastype` test, which was out of date and didn't reflect the fact that pyright now passes this test.
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.

3 participants