-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcome
Description
Summary
set-attr-with-constant (B010) should not apply when the attribute name is "__debug__".
$ cat >b010.py <<'# EOF'
x = type("C", (), {})
setattr(x, "__debug__", 0)
print(x.__debug__)
# EOF
$ python b010.py
0
$ ruff --isolated check b010.py --select B010 --fix
Found 1 error (1 fixed, 0 remaining).
$ python b010.py
File "b010.py", line 2
x.__debug__ = 0
^^^^^^^^^^^
SyntaxError: cannot assign to __debug__Version
ruff 0.11.11 (0397682 2025-05-22)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions especially welcomeContributions especially welcome