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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

(馃悶) Mypy plugin doesn't work with positional arguments on dataclasses #5117

Closed
KotlinIsland opened this issue Feb 27, 2023 · 2 comments 路 Fixed by #5120
Closed

(馃悶) Mypy plugin doesn't work with positional arguments on dataclasses #5117

KotlinIsland opened this issue Feb 27, 2023 · 2 comments 路 Fixed by #5120

Comments

@KotlinIsland
Copy link
Contributor

On main 6267ae3

import pydantic

@pydantic.dataclasses.dataclass
class A:
    a: str

A("")  # error: Too many positional arguments for "A"  [misc]

See this: #5077 (comment)

@samuelcolvin
Copy link
Member

Thanks for reporting.

See further discussion on #5077.

Happy to accept fixes for v1, or v2 once we get dataclasses working.

@cdce8p
Copy link
Contributor

cdce8p commented Feb 27, 2023

Opened #5120 to remove the kw_only_default argument.

Guess it was originally added because BaseModel only excepts keyword arguments and it was used there - copy-paste error.

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 a pull request may close this issue.

3 participants