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 — gh-69605: Disable PyREPL module autocomplete fallback on regular completion by loic-simon · Pull Request #134181 · python/cpython

Conversation

@loic-simon

@loic-simon loic-simon commented May 18, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

When no module completions are available, do not fallback on completions from current namespace, as there are not relevant.

Before:

>>> import pri<TAB>
>>> import print(
>>>
>>> from typing import Na<TAB>
>>> from typing import NameError(

After:

>>> import pri<TAB>
>>> import pri
>>>
>>> from typing import Na<TAB>
>>> from typing import Na

cc @tomasr8

  • Issue: Readline completion of module names in import statements #69605

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@loic-simon
PyREPL module autocomplete: do not fallback
8978e95
When no module completions are available, do not fallback to completions from current namespace
@loic-simon
loic-simon requested review from ambv, lysnikolaou and pablogsal as code owners May 18, 2025 14:30
@bedevere-app

bedevere-app Bot commented May 18, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot mentioned this pull request May 18, 2025
Readline completion of module names in import statements #69605
Closed
@bedevere-app bedevere-app Bot added the awaiting review label May 18, 2025
@blurb-it
📜🤖 Added by blurb_it.
ccfdf43
@ZeroIntensity
ZeroIntensity requested a review from tomasr8 May 18, 2025 14:34
tomasr8
tomasr8 reviewed May 18, 2025
View reviewed changes

@tomasr8 tomasr8 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Overall approach looks good, I just have some nitpicks 🙂

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_pyrepl/test_pyrepl.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/_pyrepl/readline.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Core_and_Builtins/2025-05-18-14-33-23.gh-issue-69605.ZMO49F.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

loic-simon added 4 commits May 19, 2025 15:45
@loic-simon
Improve blurb wording
377c761
@loic-simon
Get rid of assignment expression
99e1980
@loic-simon
Move tests to a dedicated method
dd5940e
@loic-simon
Tests: mock sys.path in setUp instead
84c4f76
tomasr8
tomasr8 approved these changes May 21, 2025
View reviewed changes

@tomasr8 tomasr8 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

loic-simon reacted with hooray emoji
All reactions
  • 🎉 1 reaction
Comment thread Lib/_pyrepl/_module_completer.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels May 21, 2025
@loic-simon
Remove extra docstring line
719875e
@ambv
ambv merged commit 0e3bc96 into python:main May 25, 2025
@bedevere-app bedevere-app Bot removed the awaiting core review label May 25, 2025
@ambv ambv added the needs backport to 3.14 bugs and security fixes label May 25, 2025
@miss-islington-app

miss-islington-app Bot commented May 25, 2025

Copy link
Copy Markdown

Thanks @loic-simon for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 25, 2025
@loic-simon @miss-islington
pythongh-69605: Disable PyREPL module autocomplete fallback on regula…
75b216c
…r completion (pythongh-134181)

(cherry picked from commit 0e3bc96)

Co-authored-by: Loïc Simon <[email protected]>
Co-authored-by: Loïc Simon <[email protected]>
@bedevere-app

bedevere-app Bot commented May 25, 2025

Copy link
Copy Markdown

GH-134680 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label May 25, 2025
ambv pushed a commit that referenced this pull request May 25, 2025
@miss-islington @loic-simon
[3.14] gh-69605: Disable PyREPL module autocomplete fallback on regul…
7216f7b
…ar completion (gh-134181) (gh-134680)

(cherry picked from commit 0e3bc96)

Co-authored-by: Loïc Simon <[email protected]>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@loic-simon @Pranjal095
pythongh-69605: Disable PyREPL module autocomplete fallback on regula…
1d9d573
…r completion (pythongh-134181)

Co-authored-by: Loïc Simon <[email protected]>
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@loic-simon @taegyunkim
pythongh-69605: Disable PyREPL module autocomplete fallback on regula…
351817c
…r completion (pythongh-134181)

Co-authored-by: Loïc Simon <[email protected]>
@loic-simon loic-simon mentioned this pull request Aug 30, 2025
gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) #138268
Merged
gostak-dd pushed a commit to gostak-dd/cpython that referenced this pull request Jun 2, 2026
@loic-simon @gostak-dd
pythongh-69605: Disable PyREPL module autocomplete fallback on regula…
eacca66
…r completion (pythongh-134181)

Co-authored-by: Loïc Simon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tomasr8 tomasr8 tomasr8 approved these changes
@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner
@ambv ambv Awaiting requested review from ambv ambv is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@loic-simon @tomasr8 @ambv
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.