Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions mypy/subtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,6 @@ def get_member_flags(name: str, itype: Instance, class_obj: bool = False) -> set
"""
info = itype.type
method = info.get_method(name)
setattr_meth = info.get_method("__setattr__")
if method:
if isinstance(method, Decorator):
if method.var.is_staticmethod or method.var.is_classmethod:
Expand All @@ -1592,7 +1591,7 @@ def get_member_flags(name: str, itype: Instance, class_obj: bool = False) -> set
assert isinstance(method, OverloadedFuncDef)
dec = method.items[0]
assert isinstance(dec, Decorator)
if dec.var.is_settable_property or setattr_meth:
if dec.var.is_settable_property or info.get_method("__setattr__"):
flags = {IS_VAR, IS_SETTABLE}
if dec.var.setter_type is not None:
flags.add(IS_EXPLICIT_SETTER)
Expand All @@ -1602,7 +1601,7 @@ def get_member_flags(name: str, itype: Instance, class_obj: bool = False) -> set
return set() # Just a regular method
node = info.get(name)
if not node:
if setattr_meth:
if info.get_method("__setattr__"):
return {IS_SETTABLE}
if itype.extra_attrs and name in itype.extra_attrs.attrs:
flags = set()
Expand Down
Loading