Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-102515: Remove unused imports in theLib/ directory#102516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 4 commits intopython:mainfromAlexWaygood:unused-imports
Mar 8, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygoodAlexWaygood commentedMar 7, 2023
edited
Loading

Identified using thepycln tool; manually reviewed by me.

@hugovk
Copy link
Member

Maybe worth commenting some of the less-obvious, required imports for next time?

@terryjreedy
Copy link
Member

Of the 34 files with 'extra' imports, 28 are in test. If the tests pass, we may assume that the deletions are really unused. I am checking the deletions in regular code and already found an error.

gvanrossum reacted with heart emoji

@terryjreedy
Copy link
Member

Guido refuted my comment about not checking tests, and found the issue with multliprocessing.connection. I consider that to be a bug in pycln.

@AlexWaygood
Copy link
MemberAuthor

I consider that to be a bug in pycln.

It's an imperfect tool, and the stdlib is possibly the worst kind of code to judge it on. I've had good experiences with using the tool on other projects, but if you simply runpycln Lib --all in the CPython repo, it removes 290 imports from 150 files. Most of these are false positives.

@rhettingerrhettinger removed their request for reviewMarch 8, 2023 02:49
@pablogsalpablogsal merged commit401d7a7 intopython:mainMar 8, 2023
@AlexWaygoodAlexWaygood deleted the unused-imports branchMarch 8, 2023 11:47
@AlexWaygood
Copy link
MemberAuthor

AlexWaygood commentedMar 8, 2023
edited
Loading

Thanks@gvanrossum,@terryjreedy and@kumaraditya303 for the careful reviews! Much appreciated.

carljm added a commit to carljm/cpython that referenced this pull requestMar 8, 2023
* main:pythongh-102304: Consolidate Direct Usage of _Py_RefTotal (pythongh-102514)pythongh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Objects/) (python#102218)pythongh-102507 Remove invisible pagebreak characters (python#102531)pythongh-102515: Remove unused imports in the `Lib/` directory (python#102516)  Remove or update bitbucket links (pythonGH-101963)pythongh-101100: Fix sphinx warnings in `zipapp` and `zipfile` modules (python#102526)pythonGH-102397: Fix segfault from race condition in signal handling (python#102399)  Fix style in argparse.rst (python#101733)  Post 3.12.0a6  fix typo in async generator code field name `ag_code` (python#102448)  Python 3.12.0a6
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gvanrossumgvanrossumgvanrossum approved these changes

@FFY00FFY00FFY00 approved these changes

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

@ethanfurmanethanfurmanAwaiting requested review from ethanfurmanethanfurman is a code owner

@ericvsmithericvsmithAwaiting requested review from ericvsmithericvsmith is a code owner

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

@vsajipvsajipAwaiting requested review from vsajip

@tirantiranAwaiting requested review from tirantiran is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatriel

@1st11st1Awaiting requested review from 1st11st1 is a code owner

@asvetlovasvetlovAwaiting requested review from asvetlovasvetlov is a code owner

Assignees
No one assigned
Labels
skip newsstdlibPython modules in the Lib dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Unused imports in theLib/ directory
8 participants
@AlexWaygood@hugovk@terryjreedy@gvanrossum@FFY00@kumaraditya303@pablogsal@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp