Skip to content

Commit 7f8d33c

Browse files
committed
Fixed an issue where overly permissive Any return types were masking type checking errors.
1 parent 6a45089 commit 7f8d33c

File tree

2 files changed

+2505
-1
lines changed

2 files changed

+2505
-1
lines changed

mypy/plugins/attrs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ def _get_attrs_init_type(typ: Instance) -> CallableType | None | AnyType:
10391039
if init_node is None or not init_node.plugin_generated:
10401040
return None
10411041
else:
1042-
return AnyType(TypeOfAny.special_form)
1042+
return init_method.type
10431043

10441044
# case 2: overloaded method
10451045
if isinstance(init_method, OverloadedFuncDef) and isinstance(init_method.type, Overloaded):

0 commit comments

Comments
 (0)