BoundMethods now have access to the function that they are using

This commit is contained in:
Dave Halter
2018-08-03 00:25:25 +02:00
parent e576457a43
commit f25310e0b9
5 changed files with 72 additions and 66 deletions
+7 -7
View File
@@ -334,15 +334,15 @@ class Evaluator(object):
parent_context = from_scope_node(parent_scope, child_is_funcdef=is_funcdef)
if is_funcdef:
func = FunctionContext.from_context(
parent_context,
scope_node
)
if isinstance(parent_context, AnonymousInstance):
func = BoundMethod(
self, parent_context, parent_context.class_context,
parent_context.parent_context, scope_node
)
else:
func = FunctionContext.from_context(
parent_context,
scope_node
instance=parent_context,
klass=parent_context.class_context,
function=func
)
if is_nested and not node_is_object:
return func.get_function_execution()