Skip to content

gh-159266: Don't reify lazy imports when completing global names in the REPL - #159267

Open
brittanyrey wants to merge 1 commit into
python:mainfrom
brittanyrey:b-pyrepl-complete-lazy
Open

brittanyrey wants to merge 1 commit into
python:mainfrom
brittanyrey:b-pyrepl-complete-lazy

Conversation

@brittanyrey

@brittanyrey brittanyrey commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Tab completing within the REPL was triggering a reify of any lazily imported module whose name matched the completer. Instead, we can look up the value directly in the namespace & finally in the builtins.

With this change you will not get colors for a lazily imported module/object until it is reified.

fancycompleter's global_matches() eval()ed every matching name to pick
its color, which imported lazily imported modules on <Tab>. Look the
value up in the namespace and builtins instead, as rlcompleter does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant