From 33accb3dc6b366b89172dd621fb7549c16a6c646 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 16 May 2016 09:52:45 +0200 Subject: [PATCH] It should be possible to pass class.__dict__ to Jedi. --- jedi/api/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index 1cb647c9..500cf550 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -10,6 +10,7 @@ import re import os import warnings import sys +import collections from itertools import chain from jedi._compatibility import unicode, builtins @@ -610,8 +611,8 @@ class Interpreter(Script): `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") + not all(isinstance(x, collections.Mapping) for x in namespaces): + raise TypeError("namespaces must be a non-empty list of dicts.") super(Interpreter, self).__init__(source, **kwds) self.namespaces = namespaces