ruff
7b4fb4fb - Fix issues with SIM101 (adjacent isinstance() calls) (#7798)

Commit
2 years ago
Fix issues with SIM101 (adjacent isinstance() calls) (#7798) - Only trigger for immediately adjacent isinstance() calls with the same target - Preserve order of or conditions Two existing tests changed: - One was incorrectly reordering the or conditions, and is now correct. - Another was combining two non-adjacent isinstance() calls. It's safe enough in that example, but this isn't safe to do in general, and it feels low-value to come up with a heuristic for when it is safe, so it seems better to not combine the calls in that case. Fixes https://github.com/astral-sh/ruff/issues/7797
Author
Parents
Loading