1
0
forked from VimPlug/jedi

Replace Scope.subscopes with iter_funcdefs and iter_classdefs.

This commit is contained in:
Dave Halter
2017-04-30 01:35:59 +02:00
parent 3e05061f3b
commit b4039872bd
10 changed files with 32 additions and 34 deletions

View File

@@ -7,6 +7,7 @@ mixing in Python code, the autocompletion should work much better for builtins.
import os
import inspect
import types
from itertools import chain
from jedi._compatibility import is_py3, builtins, unicode, is_py34
from jedi.parser.python import parse
@@ -74,7 +75,7 @@ def _load_faked_module(module):
def _search_scope(scope, obj_name):
for s in scope.subscopes:
for s in chain(scope.iter_classdefs(), scope.iter_funcdefs()):
if s.name.value == obj_name:
return s