We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fe86d1 commit fbcb4a8Copy full SHA for fbcb4a8
mypy/plugins/dataclasses.py
@@ -24,6 +24,11 @@
24
'dataclass',
25
'dataclasses.dataclass',
26
}
27
+# The set of functions that generate dataclass fields.
28
+field_makers: Final = {
29
+ 'dataclasses.field',
30
+}
31
+
32
33
SELF_TVAR_NAME: Final = "_DT"
34
@@ -490,7 +495,7 @@ def _collect_field_args(expr: Expression,
490
495
if (
491
496
isinstance(expr, CallExpr) and
492
497
isinstance(expr.callee, RefExpr) and
493
- expr.callee.fullname == 'dataclasses.field'
498
+ expr.callee.fullname in field_makers
494
499
):
500
# field() only takes keyword arguments.
501
args = {}
0 commit comments