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

fix(dataclass): unify and clarify overloads for cls None #13190

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Alviner
Copy link

@Alviner Alviner commented Dec 4, 2024

fixes #13189

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Dec 4, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

pydantic (https://github.com/pydantic/pydantic)
+ pydantic/v1/dataclasses.py:214: error: Incompatible types in assignment (expression has type "type[Any]", variable has type "DataclassProxy")  [assignment]
- pydantic/v1/dataclasses.py:214: error: No overload variant of "dataclass" matches argument types "type[Any]", "bool", "bool", "bool", "bool", "bool", "bool", "bool"  [call-overload]
- pydantic/v1/dataclasses.py:214: note: Possible overload variants:
- pydantic/v1/dataclasses.py:214: note:     def dataclass(None, /) -> Callable[[type[_T]], type[_T]]
- pydantic/v1/dataclasses.py:214: note:     def [_T] dataclass(type[_T], /) -> type[_T]
- pydantic/v1/dataclasses.py:214: note:     def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., unsafe_hash: bool = ..., frozen: bool = ..., match_args: bool = ..., kw_only: bool = ..., slots: bool = ..., weakref_slot: bool = ...) -> Callable[[type[_T]], type[_T]]
+ pydantic/dataclasses.py:256: error: Unused "type: ignore" comment  [unused-ignore]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent dataclass declaration
1 participant