1
0
forked from VimPlug/jedi

Merge the master branch into the dev branch.

This commit is contained in:
Dave Halter
2015-02-09 14:41:41 +01:00
7 changed files with 18 additions and 9 deletions

View File

@@ -34,7 +34,7 @@ As you see Jedi is pretty simple and allows you to concentrate on writing a
good text editor, while still having very good IDE features for Python.
"""
__version__ = '0.9.0-alpha0'
__version__ = '0.9.0'
from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
from jedi.api import preload_module, defined_names, names

View File

@@ -553,7 +553,7 @@ class Interpreter(Script):
upper
"""
def __init__(self, source, namespaces=[], **kwds):
def __init__(self, source, namespaces, **kwds):
"""
Parse `source` and mixin interpreted Python objects from `namespaces`.
@@ -567,6 +567,10 @@ class Interpreter(Script):
If `line` and `column` are None, they are assumed be at the end of
`source`.
"""
if type(namespaces) is not list or len(namespaces) == 0 or \
any([type(x) is not dict for x in namespaces]):
raise TypeError("namespaces must be a non-empty list of dict")
super(Interpreter, self).__init__(source, **kwds)
self.namespaces = namespaces

View File

@@ -108,7 +108,7 @@ def version_info():
Returns a namedtuple of Jedi's version, similar to Python's
``sys.version_info``.
"""
Version = namedtuple('Version', 'major, minor, micro, releaselevel, serial')
Version = namedtuple('Version', 'major, minor, micro')
from jedi import __version__
tupl = re.findall('[a-z]+|\d+', __version__)
return Version(*[x if i == 3 else int(x) for i, x in enumerate(tupl)])