Skip to content
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

[PEP 695] Fix covariance of frozen dataclasses #17783

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Commits on Sep 18, 2024

  1. [PEP 695] Fix covariance of frozen dataclasses

    Fix this conformance test:
    ```
    @DataClass(frozen=True)
    class ShouldBeCovariant4[T]:
        x: T
    
    vo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1)  # OK
    vo4_2: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1)  # E
    ```
    Link:
    https://github.com/python/typing/blob/main/conformance/tests/generics_variance_inference.py#L66
    JukkaL committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    4a479dd View commit details
    Browse the repository at this point in the history