)
)
r_arg = node.store.get_object(key=arg.id_at_location)
result_read_permissions = self.intersect_keys(
result_read_permissions, r_arg.read_permissions
)
resolved_kwargs[arg_name] = r_arg.data
// upcast our args in case the method only accepts the original types
(
upcasted_args,
upcasted_kwargs,
) = lib.python.util.upcast_args_and_kwargs(resolved_args, resolved_kwargs)
// execute the method with the newly upcasted args and kwargs
result = method(*upcasted_args, **upcasted_kwargs)
// to avoid circular imports
if lib.python.primitive_factory.isprimitive(value=result):
// Wrap in a SyPrimitive
result = lib.python.primitive_factory.PrimitiveFactory.generate_primitive(
value=result, id=self.id_at_location
)
else:
if hasattr(result, "id"):
result._id = self.id_at_location
// If we have no permission (None or {}) we add some default permissions based on a permission list
if result_read_permissions is None:
result_read_permissions = {}
if not isinstance(result, StorableObject):
result = StorableObject(
id=self.id_at_location,
data=result,
read_permissions=result_read_permissions,
)
node.store[self.id_at_location] = result
def _object2proto(self) -> RunFunctionOrConstructorAction_PB:
Returns a protobuf serialization of self.