FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-69605: fix PyREPL completions inserted for import statements with spaces by loic-simon · Pull Request #148629 · python/cpython · GitHub

/ cpython Public

gh-69605: fix PyREPL completions inserted for import statements with spaces - #148629

Open
loic-simon wants to merge 2 commits into
python:mainfrom
loic-simon:pyrepl-module-completion-fix-space-in-imports
Open

gh-69605: fix PyREPL completions inserted for import statements with spaces#148629
loic-simon wants to merge 2 commits into
python:mainfrom
loic-simon:pyrepl-module-completion-fix-space-in-imports

Conversation

loic-simon commented Apr 15, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Re: #148445 (comment)

Note: I juste found an existing bug (on main) while testing things 😅

>>> from math .<tab>
>>> from math .ath.integer  # instead of `from math .integer` (valid syntax!)

Turn out the import parser already handled these cases well, the issue was that the REPL only replaces the last entered word when inserting a suggestion, but inserted the whole import dotted name

So I added an additional step in ModuleCompleter.get_completions to reduce the completions to the portion to insert only

cc @tomasr8

Fix `from math .<tab>` inserting `from math .ath.integer` instead of `from math.integer`
loic-simon marked this pull request as ready for review April 15, 2026 20:34

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL