Skip to content
Open
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4eb226b
import fancycompleter from https://github.com/pdbpp/fancycompleter/co…
antocuni Feb 18, 2025
c5dfc85
add copyright notice
antocuni Feb 18, 2025
b561a2e
enable FancyCompleter by default, unless you set PYTHON_BASIC_COMPLETER
antocuni Feb 18, 2025
5f56673
WIP: kill a lot of code which is no longer necessary
antocuni Feb 18, 2025
40563f2
force colors for now
antocuni Feb 18, 2025
88181da
kill the logic to find a readline, we can always use _pyrepl.readline…
antocuni Feb 18, 2025
77c578a
kill LazyVersion
antocuni Feb 18, 2025
9069419
we surely don't need to support python 2.7 now :)
antocuni Feb 18, 2025
bdbe022
kill ConfigurableClass
antocuni Feb 18, 2025
0ea7c49
better name
antocuni Feb 18, 2025
6ddfa61
use _colorize instead of our own Color
antocuni Feb 18, 2025
30abd71
WIP: copy&adapt some tests from the original fancycompleter. They don…
antocuni Feb 18, 2025
983824a
edited by copilot: move from pytest-style to unittest-style
antocuni Feb 18, 2025
acbafe4
don't try to be too clever with exceptions: if a global name raises a…
antocuni Feb 18, 2025
5546b94
no longer needed
antocuni Feb 18, 2025
327648f
this doesn't test anything meaningful
antocuni Feb 18, 2025
44549b9
fix this test
antocuni Feb 18, 2025
c9c97f7
fix this test
antocuni Feb 18, 2025
c61bab6
Fix this test
antocuni Feb 18, 2025
1de48b6
Apply hugovk suggestions from code review
antocuni Sep 19, 2025
157f4b4
Apply suggestions from code review
antocuni Sep 19, 2025
722ec8a
Apply suggestions from code review
antocuni Sep 19, 2025
4554a9d
Merge branch 'main' into antocuni/fancycompleter
antocuni Sep 19, 2025
e2294ec
remove unneeded lazy import
antocuni Sep 19, 2025
4532850
Update Lib/_pyrepl/fancycompleter.py
antocuni Sep 19, 2025
1c3dd97
Merge branch 'antocuni/fancycompleter' of github.com:antocuni/cpython…
antocuni Sep 19, 2025
7089323
move import to module scope
antocuni Sep 19, 2025
926c1a3
move import
antocuni Sep 19, 2025
b6385e9
Merge branch 'main' into antocuni/fancycompleter
antocuni Sep 19, 2025
46db5d7
kill this for now, we can redintroduce it later if/when we enable fan…
antocuni Sep 19, 2025
c3ea737
this link is dead, add a comment to explain what it does instead
antocuni Sep 19, 2025
433ae06
fix precommit
antocuni Sep 19, 2025
38e8a08
we need to make this import lazy, else we get circular imports
antocuni Sep 19, 2025
4c3ad9c
now that we have themes, we can kill the config object
antocuni Sep 19, 2025
053da64
style
antocuni Sep 19, 2025
2ee47bc
📜🤖 Added by blurb_it.
blurb-it[bot] Sep 19, 2025
c3c663e
fix mypy
antocuni Sep 19, 2025
b710bce
document PYTHON_BASIC_COMPLETER
antocuni Sep 19, 2025
13a2698
try to manually fix the filename
antocuni Sep 19, 2025
72f30d9
Typo
antocuni Sep 19, 2025
b1f86ae
reword
antocuni Sep 19, 2025
af1d74e
force PYTHON_COLORS=1 for tests which expects to see colors. Hopefull…
antocuni Sep 19, 2025
c52fd7a
fix it in a different way: just look in the theme to find the expecte…
antocuni Sep 19, 2025
fdca77e
fix precommit
antocuni Sep 19, 2025
7f9d09c
Update Lib/_pyrepl/fancycompleter.py
antocuni Sep 21, 2025
3a6bcd3
put _colorize.FancyCompleter in alphabetical order w.r.t. the other s…
antocuni Sep 22, 2025
743e661
get_theme() is relatively expensive, fetch it early and cache it
antocuni Sep 26, 2025
2ebf50e
base is never used when calling commonprefix, remove it
antocuni Sep 26, 2025
bdf54ed
Update Lib/_pyrepl/fancycompleter.py
antocuni Sep 26, 2025
6a5bcfe
there is no need to sort words in advance, we can just sort names later
antocuni Sep 27, 2025
7d2c790
undo 6a5bcfe9ed: there IS actually a good reason to sort the words in…
antocuni Sep 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/_pyrepl/fancycompleter.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def attr_matches(self, text):
noprefix = '__'
else:
noprefix = None
words = sorted(words)
while True:
for word in words:
if (
Expand Down Expand Up @@ -131,6 +130,7 @@ def attr_matches(self, text):
if prefix and prefix != attr:
return [f'{expr}.{prefix}'] # autocomplete prefix

names.sort()
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not sort the values. Maybe revert the commit that introduced this if it is too much trouble to fix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, pro tip for my future self: don't write code when you are sleepy :).
commit 7d2c790 reverts it, and also adds a comment to explain WHY we need to sort words.

if self.use_colors:
return self.colorize_matches(names, values)

Expand Down
Loading