Update mypy-dev to 1.12.0a3 (#124939)

* Update mypy-dev to 1.12.0a3

* Fix
This commit is contained in:
Marc Mueller
2024-08-31 19:34:41 +02:00
committed by GitHub
parent 994c2ebca1
commit 5cd8e4ab7e
3 changed files with 8 additions and 3 deletions

View File

@@ -8,7 +8,10 @@ from __future__ import annotations
import dataclasses
import sys
from typing import Any, dataclass_transform
from typing import TYPE_CHECKING, Any, cast, dataclass_transform
if TYPE_CHECKING:
from _typeshed import DataclassInstance
def _class_fields(cls: type, kw_only: bool) -> list[tuple[str, Any, Any]]:
@@ -111,6 +114,8 @@ class FrozenOrThawed(type):
"""
cls, *_args = args
if dataclasses.is_dataclass(cls):
if TYPE_CHECKING:
cls = cast(type[DataclassInstance], cls)
return object.__new__(cls)
return cls._dataclass(*_args, **kwargs)