We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report
This standalone file produces the mistaken error models/mypy_bug.py:8: error: "str" not callable:
models/mypy_bug.py:8: error: "str" not callable
from dataclasses import dataclass, field from typing import List @dataclass class FilterExpression: match_type: str field: str value: List[str] = field(default_factory=list)
This is because mypy confuses the field "field" and the imported function "field()". Renaming the field removes the error message.
Expected Behavior
This should not be an error.
It's not obvious to me what's correct here, but this code executes as intended in Python 3.8.
So either mypy or Python 3.8 is wrong about this. I choose to file the bug with mypy.
Actual Behavior
mypy gives this error:
Your Environment
--ignore-missing-imports [paths]
mypy.ini
strict_optional = False
The text was updated successfully, but these errors were encountered:
name-defined
No branches or pull requests
Bug Report
This standalone file produces the mistaken error
models/mypy_bug.py:8: error: "str" not callable
:This is because mypy confuses the field "field" and the imported function "field()". Renaming the field removes the error message.
Expected Behavior
This should not be an error.
It's not obvious to me what's correct here, but this code executes as intended in Python 3.8.
So either mypy or Python 3.8 is wrong about this. I choose to file the bug with mypy.
Actual Behavior
mypy gives this error:
models/mypy_bug.py:8: error: "str" not callable
Your Environment
--ignore-missing-imports [paths]
mypy.ini
:strict_optional = False
The text was updated successfully, but these errors were encountered: