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

E3701: Invalid usage of field(), it should be the value of an assignment within a dataclass. (invalid-field-call) #168

Open
stdedos opened this issue Dec 13, 2024 · 1 comment

Comments

@stdedos
Copy link
Contributor

stdedos commented Dec 13, 2024

  • Dataclass Wizard version:
  • Python version:
  • Operating System:

Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

If I run exactly the "Dataclass Properties with property_wizard" (https://dataclass-wizard.readthedocs.io/en/stable/) example, I get

$  pylint p.py
************* Module p
p.py:10:0: C0115: Missing class docstring (missing-class-docstring)
p.py:11:33: E3701: Invalid usage of field(), it should be the value of an assignment within a dataclass. (invalid-field-call)
p.py:29:7: R2004: Consider using a named constant or an enum instead of '6'. (magic-value-comparison)

-----------------------------------
Your code has been rated at 5.33/10

I am just checking if this is the correct way to use it (and therefore pylint might need to learn the dataclass-wizard-way), or "you are doing something wrong".

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
@stdedos
Copy link
Contributor Author

stdedos commented Dec 13, 2024

Also

$ mypy p.py
p.py:10: error: Invalid metaclass "property_wizard"  [misc]
p.py:15: error: Name "wheels" already defined on line 11  [no-redef]
p.py:24: error: Missing positional argument "wheels" in call to "Vehicle"  [call-arg]
Found 3 errors in 1 file (checked 1 source file)

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

No branches or pull requests

1 participant