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

Filter out two underscore attributes in auto completion #568

Merged
merged 2 commits into from Oct 5, 2015

Conversation

@Tenzer
Copy link
Contributor

Tenzer commented Oct 1, 2015

This change will require you to write two underscores in order to get autocompletion of attributes starting with two underscores, as requested in #528.

I'm not too sure about the changes to the tests, and if there should be some tests for this filtering as well. I just tried to make the change as minimal as possible while making the tests pass.

This change will require you to write two underscores in order to get
autocompletion of attributes starting with two underscores, as requested
in #528.

Fixes #528
@@ -245,12 +245,12 @@ def test_att_matches_found_on_old_style_instance(self):
locals_={'a': OldStyleFoo()}),
set(['a.method', 'a.a', 'a.b']))
self.assertIn(u'a.__dict__',
self.com.matches(3, 'a._', locals_={'a': OldStyleFoo()}))
self.com.matches(3, 'a.__', locals_={'a': OldStyleFoo()}))

This comment has been minimized.

@sebastinas

sebastinas Oct 5, 2015

Contributor

If I remember correctly, the first argument should be changed to 4. @thomasballinger, can you confirm that?

This comment has been minimized.

@Tenzer

Tenzer Oct 5, 2015

Author Contributor

The tests pass with the value set to 3. I also think that makes sense with it finding a, __init__ and method. Which attribute would you say is missing?

This comment has been minimized.

@sebastinas

sebastinas Oct 5, 2015

Contributor

3 and a._ means to test for a._<Tab> while 3 and a.__ means to test for a._<Tab>_ which is a different test. The first argument is the position of the cursor at the time of the autocompletion call. So leaving the first value set to 3 does not preserve the meaning of the test.

This comment has been minimized.

@Tenzer

Tenzer Oct 5, 2015

Author Contributor

Oh, my bad. The it totally makes sense to change it to 4. I have done that in 9f3460b.

@sebastinas sebastinas merged commit 9f3460b into bpython:master Oct 5, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.