Skip to content

Inconsistent imports styles in Lib/_pyrepl #129758

Closed as not planned
Closed as not planned
@donBarbos

Description

@donBarbos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-replRelated to the interactive shelltype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions