mirror of
https://github.com/davidhalter/jedi.git
synced 2026-08-13 10:31:01 +08:00
also allow unicode, bytes, bytearray, dict -> fixes #297
This commit is contained in:
@@ -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 []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user