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

Skip to content
Prev Previous commit
Next Next commit
Update semanal.py
  • Loading branch information
BHUVANSH855 authored Apr 13, 2026
commit 53fcb408c85ad7875139c2c5ee6f169b18762604
6 changes: 5 additions & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3325,7 +3325,11 @@ def visit_assignment_stmt(self, s: AssignmentStmt) -> None:
# This should be safe as generally semantic analyzer is idempotent.
with self.allow_unbound_tvars_set():
s.rvalue.accept(self)
if self.is_class_scope():
if (
self.is_class_scope()
and not self.is_stub_file
and not self.is_typeshed_stub_file
):
for lvalue in s.lvalues:
if isinstance(lvalue, NameExpr) and lvalue.name == "__qualname__":
if not isinstance(s.rvalue, StrExpr):
Expand Down
Loading