Skip to content

False positive dataclass inheritance error for frozen models #1096

@krmozejko

Description

@krmozejko

Describe the bug
For models inheriting from BaseModel configured as frozen with class argument I get false errors:
Frozen dataclasses can not inherit non-frozen one and vice versa

Steps to reproduce
Define frozen model using class argument.

from pydantic import BaseModel


class Foo(BaseModel, frozen=True):
    a: str

Expected behavior
Error should not be visible.

Screenshots

Image

Environments (please complete the following information):

  • IDE PyCharm 2025.2.1 (Community Edition)
  • OS: macOS 15.6.1
  • Pydantic Version: 2.10.6
  • Plugin version: 0.4.19

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions