1
0
forked from VimPlug/jedi

Try to use yield from instead of yield, if possible

This commit is contained in:
Dave Halter
2020-07-19 13:34:58 +02:00
parent 5bc174bf8d
commit 9957565b37
21 changed files with 49 additions and 97 deletions

View File

@@ -184,8 +184,7 @@ class CompiledValue(Value):
def py__iter__(self, contextualized_node=None):
if not self.access_handle.has_iter():
for x in super().py__iter__(contextualized_node):
yield x
yield from super().py__iter__(contextualized_node)
access_path_list = self.access_handle.py__iter__list()
if access_path_list is None:
@@ -220,10 +219,8 @@ class CompiledValue(Value):
continue
else:
bltn_obj = builtin_from_name(self.inference_state, name)
for result in self.inference_state.execute(bltn_obj, params):
yield result
for type_ in docstrings.infer_return_types(self):
yield type_
yield from self.inference_state.execute(bltn_obj, params)
yield from docstrings.infer_return_types(self)
def get_safe_value(self, default=_sentinel):
try: