Skip to content

Commit e0ab667

Browse files
committed
Cleaner fix for spurious error
1 parent dd806cb commit e0ab667

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mypy/checkmember.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ def analyze_descriptor_assign(descriptor_type: Instance, mx: MemberContext) -> T
759759
defn=dunder_set,
760760
itype=descriptor_type,
761761
name="__set__",
762-
mx=mx.copy_modified(self_type=descriptor_type),
762+
mx=mx.copy_modified(is_lvalue=False, self_type=descriptor_type),
763763
)
764764
typ = map_instance_to_supertype(descriptor_type, dunder_set.info)
765765
dunder_set_type = expand_type_by_instance(bound_method, typ)
@@ -879,7 +879,7 @@ def analyze_var(
879879
if var.is_property:
880880
if not var.is_settable_property:
881881
mx.msg.read_only_property(name, itype.type, mx.context)
882-
elif name != "__set__":
882+
else:
883883
mx.msg.cant_assign_to_method(mx.context)
884884

885885
if not var.is_staticmethod:

0 commit comments

Comments
 (0)