What happens exactly, is that after duplicating an object, then deselecting all selected objects, using:
bpy.ops.object.duplicate()
bpy.ops.object.select_all(action='DESELECT')
then running:
bpy.data.objects['anyobject'].select=True
object is selected in red outline, not orange as usual, as a result, when editing object in edit mode, also in python, it doesn't work either
however, before running bpy.ops.object.duplicate()
, everything works properly.
I stumbled at this weird problem for a long while, i wonder how to fix it