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
{{ message }}
Repository navigation
Incorrect error in factory function on a dataclass #5263
The type first argument of class methods is patched by plugins for attrs and dataclasses (because __init__ is auto-generated). It looks like this patching is not done carefully (it needs to interact well with bind_self).
Activity
gvanrossum commentedon Jun 22, 2018
Confirmed. All I can think of is that something's wrong with how class decorators are implemented in mypy.
ilevkivskyi commentedon Jun 22, 2018
The type first argument of class methods is patched by plugins for
attrsanddataclasses(because__init__is auto-generated). It looks like this patching is not done carefully (it needs to interact well withbind_self).wkschwartz commentedon Jul 23, 2018
Workaround until this issue is fixed
Casting the result to type
Tsilences mypy's false positive error.Make classmethod's first argument be Type[...]
Make classmethod's first argument be Type[...] (#5646)