Skip to content

Commit 20c8ab5

Browse files
committed
Changes have been made based on the feedback
1 parent e1821c6 commit 20c8ab5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

mypy/nodes.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ class FuncDef(FuncItem, SymbolNode, Statement):
800800
"dataclass_transform_spec",
801801
"docstring",
802802
"deprecated",
803-
"plugin_generated",
804803
)
805804

806805
__match_args__ = ("name", "arguments", "type", "body")
@@ -813,7 +812,6 @@ def __init__(
813812
body: Block | None = None,
814813
typ: mypy.types.FunctionLike | None = None,
815814
type_args: list[TypeParam] | None = None,
816-
plugin_generated: bool | None = None,
817815
) -> None:
818816
super().__init__(arguments, body, typ, type_args)
819817
self._name = name
@@ -834,7 +832,6 @@ def __init__(
834832
# the majority). In cases where self is not annotated and there are no Self
835833
# in the signature we can simply drop the first argument.
836834
self.is_trivial_self = False
837-
self.plugin_generated = False
838835

839836
@property
840837
def name(self) -> str:

mypy/plugins/attrs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,8 @@ def _get_attrs_init_type(typ: Instance) -> CallableType | None | AnyType:
10341034
return None
10351035
# case 1: normal FuncDef
10361036
if isinstance(init_method, FuncDef) and isinstance(init_method.type, CallableType):
1037-
if init_method.plugin_generated:
1037+
init_node = typ.type.get("__init__") or typ.type.get(ATTRS_INIT_NAME)
1038+
if init_node.plugin_generated:
10381039
return init_method.type
10391040
else:
10401041
return AnyType(TypeOfAny.special_form)

0 commit comments

Comments
 (0)