Skip to content

Fix 506 #525

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

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e3dfb4f
Add Ctrl-e to complete current suggestion.
amjith Mar 13, 2015
577b9c7
use configurable keys for right arrow completion
thomasballinger Mar 13, 2015
d2287ad
Merge branch 'ctrl-e'
thomasballinger Mar 13, 2015
e83fb4a
Change default to None and set it to LOCK_EX in __init__ (fixes #509)
sebastinas Mar 15, 2015
4d26621
Move attr_{matches,lookup} to AttrCompleter
sebastinas Mar 15, 2015
5cf6f52
Makes old style classes and instances show __dict__ in the autocomplete.
Mar 15, 2015
cb90872
Adds tests to validate that __dict__ is in the autocomplete of an old
Mar 15, 2015
a82b4b5
Makes the old-style class autocomplete work in 2.6 and 3.x
Mar 15, 2015
2cfa83b
Re-introduce autocompletion modes
sebastinas Mar 16, 2015
c830c75
Update tests
sebastinas Mar 16, 2015
27b9493
Fix fuzzy completion test
sebastinas Mar 16, 2015
ad8958f
Merge remote-tracking branch 'llllllllll/old-style-class-dict-autocom…
sebastinas Mar 16, 2015
ac630cc
Move pasting logic out of Repl
sebastinas Mar 23, 2015
5cdfa51
Update translations
sebastinas Mar 23, 2015
21b9a54
Use bpython.config's getpreferredencoding
sebastinas Mar 24, 2015
38f1ed6
Remember the source of interactively defined functions
michaelmulley Mar 25, 2015
7ca380d
Move linecache code to new file, use super()
michaelmulley Mar 25, 2015
92e9b0b
No need to catch this AttributeError in test code
michaelmulley Mar 25, 2015
80765a8
Fix bpdb name
sebastinas Apr 20, 2015
bb1389a
Add Keywords
sebastinas Apr 20, 2015
a33048d
fixed bug #506
thekthuser Apr 26, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Makes the old-style class autocomplete work in 2.6 and 3.x
  • Loading branch information
llllllllll committed Mar 15, 2015
commit a82b4b5dba14a3a497560c583410f058a93a779f
6 changes: 4 additions & 2 deletions bpython/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import re
import rlcompleter
import sys
from types import InstanceType, ClassType
from six.moves import range, builtins
from six import string_types, iteritems

Expand All @@ -43,6 +42,9 @@
from bpython._py3compat import py3, try_decode
from bpython.lazyre import LazyReCompile

if not py3:
from types import InstanceType, ClassType


# Autocomplete modes
SIMPLE = 'simple'
Expand Down Expand Up @@ -540,7 +542,7 @@ def attr_lookup(obj, expr, attr):
words.remove('__abstractmethods__')
except ValueError:
pass
if isinstance(obj, (InstanceType, ClassType)):
if not py3 and isinstance(obj, (InstanceType, ClassType)):
# Account for the __dict__ in an old-style class.
words.append('__dict__')

Expand Down
2 changes: 1 addition & 1 deletion bpython/test/test_autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_att_matches_found_on_instance(self):
def test_att_matches_found_on_old_style_instance(self):
self.assertSetEqual(self.com.matches(2, 'a.',
locals_={'a': OldStyleFoo()}),
{'a.method', 'a.a', 'a.b'})
set(['a.method', 'a.a', 'a.b']))
self.assertIn(u'a.__dict__',
self.com.matches(3, 'a._', locals_={'a': OldStyleFoo()}))

Expand Down