Python: doing an action depending of the type of object hello i have a really simple problem

if my active object is an mesh i want to do an action, if its an empty another one, ... ect 

so i want for example in this case, move the location of the active object only if it's an empty 

so i tried

if bpy.context.object.type = 'EMPTY'
    bpy.context.object.location[0] = 8.46184


i really dont understand why it doesnt work, when i type 

bpy.context.object.type


in blender python console, i have 'EMPTY' as an response...

what is wrong ?
You are trying to assign 'EMPTY' to "bpy.context.object.type" within an if clause.
For checking the value of something, you need to use "==", not "=".

if bpy.context.object.type == 'EMPTY':
    bpy.context.object.location[0] = 8.46184