def _get_bases_arguments(self): arglist = self.tree_node.get_super_arglist() if arglist: from jedi.inference import arguments return arguments.TreeArguments(self.inference_state, self.parent_context, arglist) return None
def find_additions(context, arglist, add_name): params = list(arguments.TreeArguments(context.inference_state, context, arglist).unpack()) result = set() if add_name in ['insert']: params = params[1:] if add_name in ['append', 'add', 'insert']: for key, lazy_value in params: result.add(lazy_value) elif add_name in ['extend', 'update']: for key, lazy_value in params: result |= set(lazy_value.infer().iterate()) return result
def infer_trailer(context, atom_values, trailer): trailer_op, node = trailer.children[:2] if node == ')': # `arglist` is optional. node = None if trailer_op == '[': trailer_op, node, _ = trailer.children return atom_values.get_item(_infer_subscript_list(context, node), ContextualizedNode(context, trailer)) else: debug.dbg('infer_trailer: %s in %s', trailer, atom_values) if trailer_op == '.': return atom_values.py__getattribute__(name_context=context, name_or_str=node) else: assert trailer_op == '(', 'trailer_op is actually %s' % trailer_op args = arguments.TreeArguments(context.inference_state, context, node, trailer) return atom_values.execute(args)