Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into checkmember-proto
  • Loading branch information
ilevkivskyi committed May 10, 2025
commit 4b0855425a52a2a68e1950243b965d080c94eee9
14 changes: 12 additions & 2 deletions mypy/checkmember.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,14 @@ def analyze_class_attribute_access(
is_trivial_self = node.node.is_trivial_self
if isinstance(t, FunctionLike) and is_classmethod and not is_trivial_self:
t = check_self_arg(t, mx.self_type, False, mx.context, name, mx.msg)
result = add_class_tvars(t, isuper, is_classmethod, mx, original_vars=original_vars)
result = add_class_tvars(
t,
isuper,
is_classmethod,
mx,
original_vars=original_vars,
is_trivial_self=is_trivial_self,
)
# __set__ is not called on class objects.
if not mx.is_lvalue:
result = analyze_descriptor_access(result, mx)
Expand Down Expand Up @@ -1413,7 +1420,10 @@ class B(A[str]): pass
if not mx.preserve_type_var_ids:
t = freshen_all_functions_type_vars(t)
if is_classmethod:
t = bind_self(t, mx.self_type, is_classmethod=True)
if is_trivial_self:
t = bind_self_fast(t, mx.self_type)
else:
t = bind_self(t, mx.self_type, is_classmethod=True)
if isuper is not None:
t = expand_type_by_instance(t, isuper)
freeze_all_type_vars(t)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.