Many operators act from selected objects to the active object, e.g. the parenting operator bpy.ops.object.parent_set. To use it in Python I want to change the active object to the presumed parent. The code to make the object ob active in 2.79 is simply:
context.scene.objects.active = ob
However, this does not work in 2.80 because Scene.objects does not have an active attribute. So my question is, how to change the active object in 2.80?
Scene.objects does not have a link attribute either, but in 2.80 we apparently have to link an object into a collection rather than into a scene. So the 2.79 code
But Collection.objects does not have an active attribute, so that does not help in changing the active object.