You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mypy is reporting that a type[attrs.AttrsInstance] is not a valid argument to attrs.fields
To Reproduce
from __future__ importannotationsimportattrs@attrs.defineclassX:
x: intattrs.fields(X) # finedeffunc(klass: type[attrs.AttrsInstance]) ->None:
fields=attrs.fields(klass) # errorprint(fields)
func(X) # fine
Expected Behavior
% mypy x.py
Success: no issues found in 1 source file
Actual Behavior
% mypy x.py
x.py:15: error: Argument 1 to "fields" has incompatible type "type[AttrsInstance]"; expected an attrs class [misc]
Found 1 error in 1 file (checked 1 source file)
Your Environment
Mypy version used: 1.6
Mypy command-line flags: (w/ or w/o --no-incremental)
Mypy configuration options from mypy.ini (and other config files): default