Skip to content
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

Restrict what is shown when tab-completing dictionary keys #11359

Open
astrofrog opened this issue Oct 4, 2018 · 2 comments
Open

Restrict what is shown when tab-completing dictionary keys #11359

astrofrog opened this issue Oct 4, 2018 · 2 comments

Comments

@astrofrog
Copy link
Contributor

astrofrog commented Oct 4, 2018

I have tried to use _ipython_key_completions_ to specify valid tab completions for a Python object - however the example below shows that there are some default completions that are still shown:

screen shot 2018-10-04 at 10 57 18

The ones I've returned are aab and aac and I'd like to have a way to show just those and not the various magic commands and other IPython/Python commands. Is there any way to do this currently, and if not, is this something that could be added?

@blink1073
Copy link
Member

There's a programmatic way to do that given by #11318. Changing the default behavior in IPython is discussed in that PR as well.

@DouglasRaillard
Copy link

Hi,

I'm writing the comment here since the PR has been merged so I assume it will get more visibility on an open issue.

It looks like #11318 is missing a .tag(config=True) on the dict_keys_only option, which prevents it from being set using:

%config IPCompleter.dict_keys_only = True

As a side note, having it True by default would be even better :-)

Regards,
Douglas

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

No branches or pull requests

3 participants