1
0
forked from VimPlug/jedi

Add an optimization around compiled dir()

This commit is contained in:
Dave Halter
2017-12-14 22:28:22 +01:00
parent 950cab2849
commit c3efde3bfa
3 changed files with 42 additions and 8 deletions

View File

@@ -385,6 +385,17 @@ class DirectObjectAccess(object):
def is_super_class(self, exception):
return issubclass(exception, self._obj)
def get_dir_infos(self):
"""
Used to return a couple of infos that are needed when accessing the sub
objects of an objects
"""
tuples = dict(
(name, self.is_allowed_getattr(name))
for name in self.dir()
)
return self.needs_type_completions(), tuples
def _is_class_instance(obj):
"""Like inspect.* methods."""