mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-07 14:21:00 +08:00
Merge the master branch into the dev branch.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user