GeezerVison is showing github.com — gh-120417: Fix "imported but unused" linter warnings by vstinner · Pull Request #120461 · python/cpython
Conversation
vstinner
commented
Jun 13, 2024
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Add __all__ to the following modules: collections.abc, importlib.machinery, importlib.util and xml.sax.
Add also "# noqa: F401" in subprocess and xml.sax on two lines.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add __all__ to the following modules: collections.abc,
importlib.machinery, importlib.util and xml.sax.
Add also "# noqa: F401" in subprocess and xml.sax on two lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only nitpick is to put them in alphabetical order, to make it easier to find an import when scanning the list.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Jun 13, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
My only nitpick is to put them in alphabetical order, to make it easier to find an import when scanning the list.
Are you talking about __all__? I put them in definition order. I have no preference.
|
hugovk reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
I updated the PR:
- Remove private names (
_ prefix) in __all__
- Sort
__all__
- Remove
collections.abc.__all__: use # noqa instead
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is easy to get __all__ de-synchronized with the module content. I think that all changed modules need tests for __all__. See existing tests that use support.check__all__.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ericsnowcurrently and AlexWaygood reacted with thumbs up emoji
I think that all changed modules need tests for all. See existing tests that use support.check__all__.
Ok, I added tests.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I tested that __all__ includes all non-underscored names except module names.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
vstinner reacted with thumbs up emoji
mrahtz
pushed a commit
to mrahtz/cpython
that referenced
this pull request
Jun 30, 2024
…0461)
Add __all__ to the following modules:
importlib.machinery, importlib.util and xml.sax.
Add also "# noqa: F401" in collections.abc,
subprocess and xml.sax.
* Sort __all__; remove collections.abc.__all__; remove private names
* Add tests
estyxx
pushed a commit
to estyxx/cpython
that referenced
this pull request
Jul 17, 2024
…0461)
Add __all__ to the following modules:
importlib.machinery, importlib.util and xml.sax.
Add also "# noqa: F401" in collections.abc,
subprocess and xml.sax.
* Sort __all__; remove collections.abc.__all__; remove private names
* Add tests
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|