mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-25 01:38:36 +08:00
It should be possible to pass class.__dict__ to Jedi.
This commit is contained in:
@@ -10,6 +10,7 @@ import re
|
|||||||
import os
|
import os
|
||||||
import warnings
|
import warnings
|
||||||
import sys
|
import sys
|
||||||
|
import collections
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
|
||||||
from jedi._compatibility import unicode, builtins
|
from jedi._compatibility import unicode, builtins
|
||||||
@@ -610,8 +611,8 @@ class Interpreter(Script):
|
|||||||
`source`.
|
`source`.
|
||||||
"""
|
"""
|
||||||
if type(namespaces) is not list or len(namespaces) == 0 or \
|
if type(namespaces) is not list or len(namespaces) == 0 or \
|
||||||
any([type(x) is not dict for x in namespaces]):
|
not all(isinstance(x, collections.Mapping) for x in namespaces):
|
||||||
raise TypeError("namespaces must be a non-empty list of dict")
|
raise TypeError("namespaces must be a non-empty list of dicts.")
|
||||||
|
|
||||||
super(Interpreter, self).__init__(source, **kwds)
|
super(Interpreter, self).__init__(source, **kwds)
|
||||||
self.namespaces = namespaces
|
self.namespaces = namespaces
|
||||||
|
|||||||
Reference in New Issue
Block a user