Skip to content

Inconsistent imports styles in Lib/_pyrepl #129758

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

Closed
donBarbos opened this issue Feb 7, 2025 · 0 comments
Closed

Inconsistent imports styles in Lib/_pyrepl #129758

donBarbos opened this issue Feb 7, 2025 · 0 comments
Labels
stdlib Python modules in the Lib dir topic-repl Related to the interactive shell type-feature A feature request or enhancement

Comments

@donBarbos
Copy link
Contributor

donBarbos commented Feb 7, 2025

Bug report

Bug description:

After this PR #111567 there were still some strange imports in Lib/_pyrepl, for example:

TYPE_CHECKING = False
if TYPE_CHECKING:
from threading import Thread
from types import TracebackType
from typing import Protocol

# types
if False:
from .historical_reader import HistoricalReader

# types
Command = commands.Command
if False:
from .types import KeySpec, CommandName

I just want to send a PR with a uniform style and understandable for everyone.
moreover, there are imports of types that are not put in the if block, although they are used only for type hinting.

There is also a warning import twice, global import and lazy import in Lib/_pyrepl/readline.py

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@donBarbos donBarbos added the type-bug An unexpected behavior, bug, or error label Feb 7, 2025
@picnixz picnixz added stdlib Python modules in the Lib dir topic-repl Related to the interactive shell type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Feb 7, 2025
@ambv ambv closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir topic-repl Related to the interactive shell type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants