_list if key1 is None and key2 is None: call = _get_call_string(search_name) is_instance_call = _get_call_string(arglist.children[0]) # Do a simple get_code comparison of the strings . They should # just have the same code, and everything will be all right. # There are ways that this is not correct, if some stuff is # redefined in between. However here we don't care, because # it's a heuristic that works pretty well. if call == is_instance_call: lazy_cls = lazy_value_cls if lazy_cls is None: return None value_set = NO_VALUES for cls_or_tup in lazy_cls.infer(): if isinstance(cls_or_tup, iterable.Sequence) and cls_or_tup.array_type == 'tuple': for lazy_value in cls_or_tup.py__iter__(): value_set |= lazy_value.infer().execute_with_values() else: value_set |= cls_or_tup.execute_with_values() return value_set def _get_call_string(node): if node.parent.type == 'atom_expr': return _get_call_string(node.parent) code = '' leaf = node.get_first_leaf() end = node.get_last_leaf().end_pos while leaf.start_pos < end: code += leaf.value leaf = leaf.get_next_leaf() return code PK