MCPcopy
hub / github.com/Nuitka/Nuitka / computeExpressionBool

Method computeExpressionBool

nuitka/nodes/VariableRefNodes.py:603–624  ·  view source on GitHub ↗
(self, trace_collection)

Source from the content-addressed store, hash-verified

601 return call_node, None, None
602
603 def computeExpressionBool(self, trace_collection):
604 if self.variable_trace is not None:
605 attribute_node = self.variable_trace.getAttributeNode()
606
607 if attribute_node is not None:
608 if (
609 attribute_node.isCompileTimeConstant()
610 and not attribute_node.isMutable()
611 ):
612 return (
613 bool(attribute_node.getCompileTimeConstant()),
614 attribute_node.makeClone(),
615 "Using trusted constant's truth value.",
616 )
617
618 # TODO: This is probably only default stuff here, that could be compressed.
619 if not self.mayRaiseException(BaseException) and self.mayRaiseExceptionBool(
620 BaseException
621 ):
622 trace_collection.onExceptionRaiseExit(BaseException)
623
624 return None, None, None
625
626 def collectVariableAccesses(self, emit_variable):
627 emit_variable(self.variable)

Callers

nothing calls this directly

Calls 8

mayRaiseExceptionMethod · 0.95
mayRaiseExceptionBoolMethod · 0.95
getAttributeNodeMethod · 0.45
isCompileTimeConstantMethod · 0.45
isMutableMethod · 0.45
makeCloneMethod · 0.45
onExceptionRaiseExitMethod · 0.45

Tested by

no test coverage detected