Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PEP 695] Fix covariance of frozen dataclasses#17783

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JukkaL merged 1 commit intomasterfromvariance-dataclass
Sep 18, 2024

Conversation

@JukkaL
Copy link
Collaborator

Fix this conformance test:

@dataclass(frozen=True)class ShouldBeCovariant4[T]:    x: Tvo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1)  # OKvo4_2: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1)  # E

Link:
https://github.com/python/typing/blob/main/conformance/tests/generics_variance_inference.py#L66

Fix this conformance test:```@DataClass(frozen=True)class ShouldBeCovariant4[T]:    x: Tvo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1)  # OKvo4_2: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1)  # E```Link:https://github.com/python/typing/blob/main/conformance/tests/generics_variance_inference.py#L66
@github-actions
Copy link
Contributor

According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@JukkaLJukkaL merged commit9d7a042 intomasterSep 18, 2024
@JukkaLJukkaL deleted the variance-dataclass branchSeptember 18, 2024 13:42
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@svalentinsvalentinsvalentin approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@JukkaL@svalentin

[8]ページ先頭

©2009-2025 Movatter.jp