Skip to content

Filter private methods from tab completion #1850

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 4 commits into from
May 8, 2019

Conversation

katlings
Copy link

@katlings katlings commented May 6, 2019

Issue #1636

I built and installed this on my CPX and it works the way I expected:

Adafruit CircuitPython 4.0.0-rc.1-23-g54aa1ce6d on 2019-05-06; Adafruit CircuitPlayground Express with samd21g18
>>> class Test:
...     def _internal(self):
...         return 1
...     
...     def external(self):
...         return 2
...     
...     def external_foo(self):
...         return 3
...     
...     def foo(self):
...         return 4
...         
...         
... 
>>> Test.
external        external_foo    foo
>>> Test.external
external        external_foo
>>> Test._
__class__       __module__      __name__        __qualname__
_internal
>>> Test.__
__class__       __module__      __name__        __qualname__

@katlings
Copy link
Author

katlings commented May 6, 2019

FWIW, this also allows the special case for autocompleting "import " when pressing tab at the start of a line to work (previously for me, it started with __name__)!

deshipu
deshipu previously approved these changes May 6, 2019
@katlings
Copy link
Author

katlings commented May 7, 2019

This is ready! :D

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Woohoo! Thank you!

@tannewt tannewt merged commit 909210e into adafruit:master May 8, 2019
tyomitch pushed a commit to tyomitch/circuitpython that referenced this pull request Apr 30, 2021
Originally at adafruit#1850

Signed-off-by: Kathryn Lingel <kathryn@lingel.net>
dpgeorge pushed a commit to micropython/micropython that referenced this pull request May 2, 2021
Anything beginning with "_" will now only be tab-completed if there is
already a partial match for such an entry.  In other words, entering
foo.<tab> will no longer complete/list anything beginning with "_".

Originally at adafruit#1850

Signed-off-by: Kathryn Lingel <kathryn@lingel.net>
ksekimoto pushed a commit to ksekimoto/micropython that referenced this pull request Jul 16, 2021
Anything beginning with "_" will now only be tab-completed if there is
already a partial match for such an entry.  In other words, entering
foo.<tab> will no longer complete/list anything beginning with "_".

Originally at adafruit#1850

Signed-off-by: Kathryn Lingel <kathryn@lingel.net>
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.

3 participants