gh-151428: Remove unused imports from stdlib#151478
Conversation
Attracts lin[kt]er errors |
AlexWaygood
left a comment
There was a problem hiding this comment.
(I only reviewed the changes to the config files)
| [per-file-target-version] | ||
| "jit/example_trace_dump.py" = "py312" # Reused-quote f-strings (PEP 701) |
There was a problem hiding this comment.
should this be the target version for the whole jit directory, rather than just one file...?
| [lint.per-file-ignores] | ||
| "c-analyzer/c_parser/__init__.py" = ["F401"] # Re-exports from submodules | ||
| "c-analyzer/c_parser/preprocessor/__init__.py" = ["F401"] # Re-exports from submodules | ||
| "c-analyzer/c_parser/preprocessor/common.py" = ["F401"] # Re-exported by preprocessor/__init__.py |
There was a problem hiding this comment.
Adding __all__ and listing the re-exports in __all__ would probably be a more idiomatic way of fixing these errors (but perhaps that's something for a followup PR, since there's a chance it could be controversial :-)
|
|
||
| [lint.per-file-ignores] | ||
| "ctypes/__init__.py" = ["F401"] # Re-exports from _ctypes | ||
| "ensurepip/__init__.py" = ["F401"] # `import zlib` availability check |
There was a problem hiding this comment.
in a case like this where there's only one error, I'd usually lean towards using a noqa comment in the code rather than per-file-ignores. But, again, perhaps that's best done as a followup..
Keeping those linters busy man 😉 |
Follow on from #151440 and #151442.
Also add Ruff F401 to help avoid this in the future, and exclude any files with false positives (rather than adding
noqacomments).