also allow unicode, bytes, bytearray, dict -> fixes #297

This commit is contained in:
Dave Halter
2014-04-07 16:16:31 +02:00
parent 193e04ae8e
commit d2dc39e0c2
+2 -2
View File
@@ -6,7 +6,7 @@ import re
import sys import sys
import os import os
from jedi._compatibility import builtins as _builtins from jedi._compatibility import builtins as _builtins, unicode
from jedi import debug from jedi import debug
from jedi.cache import underscore_memoization from jedi.cache import underscore_memoization
from jedi.evaluate.sys_path import get_sys_path from jedi.evaluate.sys_path import get_sys_path
@@ -99,7 +99,7 @@ class CompiledObject(Base):
if not hasattr(self.obj, '__getitem__'): if not hasattr(self.obj, '__getitem__'):
debug.warning('Tried to call __getitem__ on non-iterable.') debug.warning('Tried to call __getitem__ on non-iterable.')
return [] return []
if type(self.obj) not in (str, list, tuple): if type(self.obj) not in (str, list, tuple, unicode, bytes, bytearray, dict):
# Get rid of side effects, we won't call custom `__getitem__`s. # Get rid of side effects, we won't call custom `__getitem__`s.
return [] return []