Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:davidhalter/jedi into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhalter committed Dec 2, 2012
2 parents 90fd3de + 773546c commit 1940fbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jedi/api_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class BaseOutput(object):
'os2emxpath': 'os.path',
'macpath': 'os.path',
'genericpath': 'os.path',
'_io': 'io'
'_io': 'io',
'__builtin__': '',
'builtins': '',
}

_tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in {
Expand Down Expand Up @@ -101,7 +103,7 @@ def full_name(self):
if tuple(path[:len(key)]) == key:
path = [repl] + path[len(key):]

return '.'.join(path)
return '.'.join(path if path[0] else path[1:])

def __repr__(self):
return "<%s %s>" % (type(self).__name__, self.description)
Expand Down
3 changes: 3 additions & 0 deletions test/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ def test_full_name(self):
assert self.complete('import os; os.path.join')[0].full_name \
== 'os.path.join'

def test_full_name_builtin(self):
self.assertEqual(self.complete('type')[0].full_name, 'type')

def test_full_name_tuple_mapping(self):
s = """
import re
Expand Down

0 comments on commit 1940fbe

Please sign in to comment.