Skip to content

Remove duplicate import in Lib/pydoc.py #135215

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StanFromIreland
Copy link
Contributor

@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).

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.

4 participants