How to apply list of rotations to multiple bones using animation nodes
While it is not encouraged, you can technically use list comprehensions as follows. A list comprehension takes the form:

[element.attribute for element in elements]


element.attribute has to be an actual object, thus writing an assignment operator instead like bone.rotation_quaternion = quat won't work, because assignment operators won't return anything. However, if you used the setattr() function, it will execute and return None. In conclusion, you can write the expression as follows:

[setattr(bone, "rotation_quaternion", quaternion) for bone, quaternion in zip(object.pose.bones, quaternions)]




If you want to assign the quaternion only to the bones at the indices defined by an integer list, you would use an expression as follows:

[setattr(object.pose.bones[i], "rotation_quaternion", quaternions[i]) for i in indices]


Instead of looping over the bones and quaternions themselves, you loop over the indices and get the bones and quaternions at the current index.



If you quaternion list is masked based on the indices, then you should loop over the quaternions directly as follows:

[setattr(object.pose.bones[i], "rotation_quaternion", quaternion) for i, quaternion in zip(indices, quaternions)]