Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Feature: Add open close parentheses for attribute suggestions that are methods#840

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
rybarczykj wants to merge1 commit intobpython:main
base:main
Choose a base branch
Loading
fromrybarczykj:complete

Conversation

rybarczykj
Copy link
Contributor

@rybarczykjrybarczykj commentedAug 6, 2020
edited
Loading

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.
now
My proposal: open AND close parens in suggestion, no parens in autofill. Now typing the open paren shows the method signature.
new
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.
old
My proposal: open close parens in suggestion, no parens in autofill. Very clear which attrs are methods.
old
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
Copy link
Member

I personally like this, and I think at least the second part, attribute completion changes, should be added.

@sebastinassebastinas added this to theNew features milestoneOct 12, 2020
@codecov-commenter
Copy link

codecov-commenter commentedJul 15, 2021
edited
Loading

Codecov Report

Merging#840 (0cc3b86) intomain (d07a405) willdecrease coverage by0.19%.
The diff coverage is85.71%.

Impacted file tree graph

@@            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
Impacted FilesCoverage Δ
bpython/repl.py72.32% <83.33%> (+0.05%)⬆️
bpython/autocomplete.py85.84% <87.50%> (+0.21%)⬆️
bpython/inspection.py83.90% <0.00%> (-2.93%)⬇️
bpython/test/test_repl.py91.35% <0.00%> (-2.47%)⬇️
bpython/test/test_importcompletion.py92.00% <0.00%> (-2.00%)⬇️
bpython/test/test_interpreter.py80.35% <0.00%> (-1.79%)⬇️
bpython/test/test_autocomplete.py94.44% <0.00%> (-0.40%)⬇️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updated07a405...0cc3b86. Read thecomment docs.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
New features
Development

Successfully merging this pull request may close these issues.

4 participants
@rybarczykj@thomasballinger@codecov-commenter@sebastinas

[8]ページ先頭

©2009-2025 Movatter.jp