예제 #1
0
 def py__call__(self, params):
     if inspect.isclass(self.obj):
         from jedi.evaluate.context import CompiledInstance
         return ContextSet(
             CompiledInstance(self.evaluator, self.parent_context, self,
                              params))
     else:
         return ContextSet.from_iterable(self._execute_function(params))
예제 #2
0
 def py__call__(self, arguments):
     if self.access_handle.is_class():
         from jedi.evaluate.context import CompiledInstance
         return ContextSet([
             CompiledInstance(self.evaluator, self.parent_context, self, arguments)
         ])
     else:
         return ContextSet(self._execute_function(arguments))
예제 #3
0
 def py__call__(self, params):
     if self.tree_node is not None and self.tree_node.type == 'funcdef':
         from jedi.evaluate.context.function import FunctionContext
         return FunctionContext(self.evaluator,
                                parent_context=self.parent_context,
                                funcdef=self.tree_node).py__call__(params)
     if self.access_handle.is_class():
         from jedi.evaluate.context import CompiledInstance
         return ContextSet(
             CompiledInstance(self.evaluator, self.parent_context, self,
                              params))
     else:
         return ContextSet.from_iterable(self._execute_function(params))
예제 #4
0
파일: context.py 프로젝트: kavinvin/jedi
 def py__call__(self, arguments):
     try:
         self.access_handle.getattr_paths(u'__call__')
     except AttributeError:
         return super(CompiledObject, self).py__call__(arguments)
     else:
         if self.access_handle.is_class():
             from jedi.evaluate.context import CompiledInstance
             return ContextSet([
                 CompiledInstance(self.evaluator, self.parent_context, self,
                                  arguments)
             ])
         else:
             return ContextSet(self._execute_function(arguments))
예제 #5
0
파일: context.py 프로젝트: huohuoya/jedi
    def py__call__(self, arguments):
        return_annotation = self.access_handle.get_return_annotation()
        if return_annotation is not None:
            # TODO the return annotation may also be a string.
            return create_from_access_path(self.evaluator, return_annotation).execute_annotation()

        try:
            self.access_handle.getattr_paths(u'__call__')
        except AttributeError:
            return super(CompiledObject, self).py__call__(arguments)
        else:
            if self.access_handle.is_class():
                from jedi.evaluate.context import CompiledInstance
                return ContextSet([
                    CompiledInstance(self.evaluator, self.parent_context, self, arguments)
                ])
            else:
                return ContextSet(self._execute_function(arguments))