Content-Length: 285041 | pFad | https://github.com/python/cpython/issues/109409

D6 frozen dataclass inheritance is not strictly checked in multiple inheritance · Issue #109409 · python/cpython · GitHub
Skip to content

frozen dataclass inheritance is not strictly checked in multiple inheritance #109409

@Batman-q96

Description

@Batman-q96

Bug report

Bug description:

import dataclasses

@dataclasses.dataclass
class NotFrozen:
    pass

@dataclasses.dataclass(frozen=True)
class Frozen:
    pass

@dataclasses.dataclass(frozen=True)
class Child(NotFrozen, Frozen):
    pass

The dataclass inheritance hierarchy is supposed to require all classes to be either frozen or non frozen, this works properly for checking that an unfrozen class does not inherit from any frozen classes, but it allows frozen classes to inherit from unfrozen ones as long as there's at least one frozen class in the MI

CPython versions tested on:

3.10

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

Labels

type-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/109409

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy