diff --git a/jedi/evaluate/compiled/subprocess/__init__.py b/jedi/evaluate/compiled/subprocess/__init__.py index d9100895..37e3f250 100644 --- a/jedi/evaluate/compiled/subprocess/__init__.py +++ b/jedi/evaluate/compiled/subprocess/__init__.py @@ -275,6 +275,18 @@ class AccessHandle(object): #print >> sys.stderr, name #print('getattr', name, file=sys.stderr) - def compiled_method(*args, **kwargs): + return partial(self._workaround, name) + + def _workaround(self, name, *args, **kwargs): + """ + TODO Currently we're passing slice objects around. This should not + happen. They are also the only unhashable objects that we're passing + around. + """ + if args and isinstance(args[0], slice): return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) - return compiled_method + return self._cached_results(name, *args, **kwargs) + + @memoize_method + def _cached_results(self, name, *args, **kwargs): + return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs)