mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Move py__call__to FunctionMixin
This commit is contained in:
@@ -64,6 +64,12 @@ class FunctionMixin(object):
|
||||
return LambdaName(self)
|
||||
return ContextName(self, self.tree_node.name)
|
||||
|
||||
def py__call__(self, arguments, need_param_match=False):
|
||||
function_execution = self.get_function_execution(arguments)
|
||||
if need_param_match and not function_execution.matches_signature():
|
||||
return NO_CONTEXTS
|
||||
return function_execution.infer()
|
||||
|
||||
def get_function_execution(self, arguments=None):
|
||||
if arguments is None:
|
||||
arguments = AnonymousArguments()
|
||||
@@ -113,12 +119,6 @@ class FunctionContext(use_metaclass(CachedMetaClass, FunctionMixin, TreeContext)
|
||||
)
|
||||
return function
|
||||
|
||||
def py__call__(self, arguments, need_param_match=False):
|
||||
function_execution = self.get_function_execution(arguments)
|
||||
if need_param_match and not function_execution.matches_signature():
|
||||
return NO_CONTEXTS
|
||||
return function_execution.infer()
|
||||
|
||||
def py__class__(self):
|
||||
return compiled.get_special_object(self.evaluator, u'FUNCTION_CLASS')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user