GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Inconsistent imports styles in `Lib/_pyrepl` · Issue #129758 · python/cpython

Inconsistent imports styles in Lib/_pyrepl #129758

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Inconsistent imports styles in Lib/_pyrepl#129758
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement

Description

@donbarbos
donbarbos
opened on Feb 7, 2025
Issue body actions

Bug report

Bug description:

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

cpython/Lib/_pyrepl/_threading_handler.py

Lines 7 to 11 in 4e3330f

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

cpython/Lib/_pyrepl/commands.py

Lines 35 to 37 in 4e3330f

# types
if False:
from .historical_reader import HistoricalReader

cpython/Lib/_pyrepl/completing_reader.py

Lines 30 to 33 in 4e3330f

# 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

  • gh-129758: Correct imports in Lib/_pyrepl #129761

Activity

  1. donbarbos
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Feb 7, 2025
  2. picnixz
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    topic-replRelated to the interactive shellRelated to the interactive shell
    type-featureA feature request or enhancementA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Feb 7, 2025
  3. ambv
    closed this as not plannedon Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.