Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-69605: Disable PyREPL module autocomplete fallback on regular completion #134181

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

Merged
merged 7 commits into from
May 25, 2025

Conversation

loic-simon
Copy link
Contributor

@loic-simon loic-simon commented May 18, 2025

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

When no module completions are available, do not fallback to completions from current namespace
@bedevere-app
Copy link

bedevere-app bot commented May 18, 2025

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.

@ZeroIntensity ZeroIntensity requested a review from tomasr8 May 18, 2025 14:34
Copy link
Member

@tomasr8 tomasr8 left a 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 🙂

Lib/test/test_pyrepl/test_pyrepl.py Outdated Show resolved Hide resolved
Lib/_pyrepl/readline.py Outdated Show resolved Hide resolved
Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

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

LGTM!

Lib/_pyrepl/_module_completer.py Outdated Show resolved Hide resolved
@ambv ambv merged commit 0e3bc96 into python:main May 25, 2025
47 checks passed
@ambv ambv added the needs backport to 3.14 bugs and security fixes label May 25, 2025
@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 25, 2025
…r completion (pythongh-134181)

(cherry picked from commit 0e3bc96)

Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Co-authored-by: Loïc Simon <loic.simon@napta.io>
@bedevere-app
Copy link

bedevere-app bot commented May 25, 2025

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

@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
…ar completion (gh-134181) (gh-134680)

(cherry picked from commit 0e3bc96)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.