ruff
8d956e04 - [`pyflakes`] Fix false positive for names shadowing re-exports (`F811`) (#23356)

Commit
13 hours ago
[`pyflakes`] Fix false positive for names shadowing re-exports (`F811`) (#23356) ## Summary Fixes #10874. In stub files, explicit re-exports (`from x import y as y`) at module scope were falsely flagged as redefined (F811) by class-scoped attributes with the same name. A class attribute binding in a nested scope should not invalidate a module-level re-export. Skip the F811 diagnostic when the shadowed binding is an explicit re-export (`is_explicit_export()`). ## Test plan - Reproduction case: `ruff check --select F811 stub.pyi` no longer emits false positive - `cargo test -p ruff_linter -- pyflakes` — all 462 tests pass
Author
Parents
Loading