Feature: Add open close parentheses for attribute suggestions that are methods by rybarczykj · Pull Request #840 · bpython/bpython
Repository navigation
Feature: Add open close parentheses for attribute suggestions that are methods - #840
Draft
rybarczykj wants to merge 1 commit into bpython:main from rybarczykj:complete
Draft
Feature: Add open close parentheses for attribute suggestions that are methods #840 rybarczykj wants to merge 1 commit into bpython:main from rybarczykj:complete
Conversation
rybarczykj commented Aug 6, 2020 · edited Loading
Copy link Copy Markdown
Contributor
TLDR:
- Parenthesis on attribute suggestions so it's clear which attributes are methods
- Slight modification to how parentheses are autofilled
Sorry for the bad quality gifs. I should stop using GIPHY for this.
Native function completion
Current behavior: open parenthesis in suggestion and autofill. You have to type something after the paren before you can see the method signature.
My proposal: open AND close parens in suggestion, no parens in autofill. Now typing the open paren shows the method signature.
This might mess with some people's muscle memory since it changes what's autofilled.
Attributute completion
Current behavior: no parens in suggestion or autofill. You can't tell what is a method or otherwise.
My proposal: open close parens in suggestion, no parens in autofill. Very clear which attrs are methods.
Since this only changes the infobox, it shouldn't mess with anyone's muscle memory.
If this seems worth implementing, I'll need to fix some tests. Right now, tests expect matches that look like "math.cos" or "any(", but they'll be getting matches that look like "math.cos()" and "any()".
Also I'm not sure if I implemented this the best way. The way I did it, the actual match string is altered to have parens. Maybe it's better to leave the match as-is, but add parenthesis only on the front end. This would require some passing around of information. Feedback appreciated.
thomasballinger commented Oct 11, 2020
Copy link Copy Markdown
Member
|
I personally like this, and I think at least the second part, attribute completion changes, should be added. |
codecov-commenter commented Jul 15, 2021 · edited Loading
Copy link Copy Markdown
Codecov Report
@@ Coverage Diff @@ ## main #840 +/- ## ========================================== - Coverage 67.95% 67.76% -0.20% ========================================== Files 61 61 Lines 9144 9154 +10 ========================================== - Hits 6214 6203 -11 - Misses 2930 2951 +21
Continue to review full report at Codecov .
|
Update (unfinished) PR to present day
0cc3b86
rybarczykj
force-pushed
the
complete
branch
from
0d66d26 to
0cc3b86
Compare
July 15, 2021 21:39 sebastinas force-pushed the main branch from
2a7cc5e to
1333695
Compare
September 8, 2025 08:39 Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment