Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bpo-37765: Add keywords to IDLE tab completions #15138

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 9, 2020

Conversation

terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Aug 5, 2019

Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

https://bugs.python.org/issue37765

Copy link
Member

@tirkarthi tirkarthi left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @terryjreedy .

Copy link
Contributor

@csabella csabella left a comment

Choose a reason for hiding this comment

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

Make sure list has no duplicates.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@terryjreedy terryjreedy added the needs backport to 3.9 only security fixes label May 25, 2020
@terryjreedy terryjreedy changed the title bpo-37765: Add keywords to IDLE's main completion list bpo-37765: Add longer keywords to IDLE tab completions Jul 7, 2020
@terryjreedy
Copy link
Member Author

terryjreedy commented Jul 8, 2020

Cheryl, please review again, including the rewritten Completions section.
...
Tal thinks adding half is worse that adding all, so I will change back when fresher.

Comment on lines 481 to 482
adding and deleting characters, with Up, Down, Page Up, Page Down, Home
and End keys, and by a single click within the box. Keys <Escape>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Here you mention keys without enclosing them in brackets, but in the next line you enclose the keys in brackets. You also use the :kbd: directive below. Was there a reason for using different styles?

Copy link
Member Author

@terryjreedy terryjreedy Jul 9, 2020

Choose a reason for hiding this comment

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

I was consistent within sentences ;-). Habit and history. The directive translates to <kbd class="kbd docutils literal notranslate">Backspace</kbd>. In my Firefox, this displays a slightly bold sans serif. The contrast with normal text depends on whether normal text has serifs or not, and with styling turned on, it does not. In help.py, the kbd tag is not translated, so no contrast. We should revise that to 'em' (currently italics) or a new tk 'bd' tag.

being completed and the item highlighted in the box can be changed by
adding and deleting characters, with Up, Down, Page Up, Page Down, Home
and End keys, and by a single click within the box. Keys <Escape>,
<Enter>, and double <Tab> and clicks outside the box close the box.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think 'close the box' is the point of this sentence, but it gets lost. It might be clearer to start with that. Or, alternatively, to reformat this paragraph somehow as a navigation section with bullets or subsections. Something like

Open the completion list:
Get new completions:
Select a completion:
Close the box:

Copy link
Member Author

@terryjreedy terryjreedy Jul 9, 2020

Choose a reason for hiding this comment

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

I revised to "Close the box with ...", parallel to previous sentence. As to structure, we have a 3 dimensions: Open method (wait, hot key, tab), namespace (main, attribute, files), and stage (open select, close), with some cells blank (wait never opens the main namespace) and some entries identical. The existing order made little sense to me. I started with select and close because these are common to all open methods and lists. I made this more explicit. I follow with the 3 invocation methods and module level completions.

In any case, there are more edits all through the doc and a will wait a day for more comments before merging.

@csabella
Copy link
Contributor

csabella commented Jul 8, 2020

The functionality works as designed. I agree with Tal that having some missing keywords (like pass) is a little awkward.

@terryjreedy terryjreedy changed the title bpo-37765: Add longer keywords to IDLE tab completions bpo-37765: Add keywords to IDLE tab completions Jul 9, 2020
@terryjreedy terryjreedy removed needs backport to 3.7 type-feature A feature request or enhancement labels Jul 9, 2020
@terryjreedy terryjreedy merged commit bce2eb4 into python:master Jul 9, 2020
@miss-islington
Copy link
Contributor

Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 9, 2020
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <[email protected]>
(cherry picked from commit bce2eb4)

Co-authored-by: Terry Jan Reedy <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Jul 9, 2020
@bedevere-bot
Copy link

GH-21423 is a backport of this pull request to the 3.9 branch.

@bedevere-bot
Copy link

GH-21424 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 9, 2020
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <[email protected]>
(cherry picked from commit bce2eb4)

Co-authored-by: Terry Jan Reedy <[email protected]>
@terryjreedy terryjreedy deleted the c_keyword branch July 9, 2020 22:49
miss-islington added a commit that referenced this pull request Jul 9, 2020
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <[email protected]>
(cherry picked from commit bce2eb4)

Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington added a commit that referenced this pull request Jul 9, 2020
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <[email protected]>
(cherry picked from commit bce2eb4)

Co-authored-by: Terry Jan Reedy <[email protected]>
arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <[email protected]>
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Aug 20, 2020
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <[email protected]>
xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants