Overloaded __init__
prevents type from being recognized as an attrs class
#19003
Labels
__init__
prevents type from being recognized as an attrs class
#19003
Bug Report
When an
attrs
class has and overloaded__init__
function, mypy does not consider it to be anattrs
class when evaluatingattrs.evolve
.To Reproduce
Expected Behavior
The
C
instance should be an acceptable input toattrs.evolve
.Actual Behavior
Your Environment
mypy 1.15.0
mypy.ini
(and other config files): nonePython 3.13.0 (v3.13.0:60403a5409f, Oct 7 2024, 00:37:40) [Clang 15.0.0 (clang-1500.3.9.4)]
Notes
This appears to be because the init method is both not a
FuncDef
(it isOverloadedFuncDef
) and itstype
attribute is not aCallableType
. See:mypy/mypy/plugins/attrs.py
Lines 1033 to 1034 in 7b4f631
The text was updated successfully, but these errors were encountered: