You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ruff_F841.py:6:16: F841 Local variable `secund` is assigned to but never used
|
5 | def main(self):
6 | first, secund = self.bar()
| ^^^^^^ F841
7 |
8 | print(first)
|
= help: Remove assignment to unused variable `secund`
Found 1 error.
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
The current Ruff settings
Just the defaults with no customization
The current Ruff version
ruff 0.2.1
The text was updated successfully, but these errors were encountered:
Hey sorry -- this is intended and it's covered in the rule documentation: https://docs.astral.sh/ruff/rules/unused-variable/. Right now, we don't lint against unused variables in tuples if at least one of them is used, but we're considering changing that behavior (hence why the revised logic is present in preview).
BTW, this behaviour does not respect the explicit-preview-rules option. When having explicit-preview-rules = true, I was expecting to not have any preview behaviour unless the rule is explicitly selected.
Currently,
F841
is not in preview. However, it will catch the following unused variable (i.e.,secund
) only when the preview mode is enabled.Minimal code snippet
Invoked commands
The following command shows no errors:
While enabling the preview shows an
F841
error:The current Ruff settings
Just the defaults with no customization
The current Ruff version
The text was updated successfully, but these errors were encountered: