8000 gh-125142: remove duplicated import in `Lib/pydoc.py` by StanFromIreland · Pull Request #135215 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-125142: remove duplicated import in Lib/pydoc.py #135215 8000

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

StanFromIreland
Copy link
Member
@StanFromIreland StanFromIreland commented Jun 6, 2025

We could go the other way around, this was introduced quite recently in 68a7376

cc @nascheme (Author)

@nascheme
Copy link
Member
nascheme commented Jun 6, 2025

LGTM.

@AA-Turner
Copy link
Member

These look like intentionally deferred imports. Perhaps remove the module-level import?

@nascheme
Copy link
Member
nascheme commented Jun 6, 2025

When I originally wrote my change, the use of textwrap in _introdoc() was the only instance in the pydoc module. So, I decided to do it at the function level. Now that the module is used in two different places, doing the module level import is okay, I think. Importing pydoc should not really be performance sensitive anyhow, should it? I think it would be fine to do it either way (module level or function level).

@StanFromIreland StanFromIreland requested a review from nascheme June 24, 2025 13:51
@picnixz picnixz changed the title Remove duplicate import in Lib/pydoc.py gh-125142: remove duplicated import in Lib/pydoc.py Jun 24, 2025
@nascheme nascheme merged commit 0fadd9f into python:main Jun 26, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0