Bug Report
Specifying frozen=True as model class kwargs for pydantic models causes the following error to be emitted from mypy:
Cannot inherit frozen dataclass from a non-frozen one
To Reproduce
- Install pydantic and mypy:
pip install pydantic mypy
- Create
test.py with the following content:
from pydantic import BaseModel
class MyModel(BaseModel, frozen=True):
my_val: int
- Run
mypy on the test file: mypy test.py
Expected Behavior
No errors reported (as was the case with mypy 1.0.1):
> mypy test.py
Success: no issues found in 1 source file
Actual Behavior
Errors reported:
> mypy test.py
test.py:3: error: Cannot inherit frozen dataclass from a non-frozen one [misc]
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 1.1.1
- Python version used: 3.10
Bug Report
Specifying
frozen=Trueas model class kwargs for pydantic models causes the following error to be emitted frommypy:To Reproduce
pip install pydantic mypytest.pywith the following content:mypyon the test file:mypy test.pyExpected Behavior
No errors reported (as was the case with mypy 1.0.1):
Actual Behavior
Errors reported:
Your Environment