Q:

Python, why is the enumerated list not changing the object in 3D View Property Shelf, while it's working in the Tool shelf

I wrote the following script to test creating a new panel in the properties shelf in 3D view (the one that toggles visibility using N). 
The script is working for creating object, but the enumerated list isn't changing the object as I'm expecting it to, while it's working in the Tool shelf in 3D view, or using F6.
What's wrong with my code?
import bpy
from bpy.props import *

class whatever_OP(bpy.types.Operator):

    bl_idname = "object.set_enum_prop"
    bl_label = "Whatever"
    bl_options = {'REGISTER','UNDO'}

    def update_enum (self,context):
        self= [('0','Cube',""),
            ('1','Ico_sphere',""),
            ('2','Cone',"")
            ]

    Axis = [('0','Cube',""),
            ('1','Ico_sphere',""),
            ('2','Cone',"")
            ]

    enum_prop = EnumProperty \
        (
        items = Axis,
        name ="Add",
        description = "Set the Axis",
        #default = '2',
        update = update_enum
        )

    def execute(self,context):

        enum_prop = int(self.enum_prop)

        if enum_prop == 0:
            bpy.ops.mesh.primitive_cube_add()
        elif enum_prop == 1:
            bpy.ops.mesh.primitive_ico_sphere_add()
        elif enum_prop == 2:
            bpy.ops.mesh.primitive_cone_add()
        else:
            print ("None")

        return {"FINISHED"}

class whatever_panel(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_label = "Whatever Panel"

    @classmethod
    def poll(cls, context):
        if bpy.context.object.type == 'MESH' :
            return True

    def draw(self, context):

        layout = self.layout
        layout.operator("object.set_enum_prop", "Add Mesh")
        layout.prop(context.scene, "set_enum_prop") 

#register

def register():
    bpy.utils.register_class(whatever_panel)
    bpy.utils.register_class(whatever_OP)
    bpy.types.Object.set_enum_prop = whatever_OP.enum_prop

def unregister():
    bpy.utils.unregister_class(whatever_panel)
    bpy.utils.unregister_class(whatever_OP)
    del bpy.types.Object.set_enum_prop

if __name__ == "__main__":
    register()  

A:

There is a few things wrong with your code. Here it is corrected for you to compare:
import bpy
from bpy.props import *

Axis = [('0','Cube',""),
        ('1','Ico_sphere',""),
        ('2','Cone',"")
        ]

class whatever_OP(bpy.types.Operator):

    bl_idname = "object.set_enum_prop"
    bl_label = "Whatever"
    bl_options = {'REGISTER','UNDO'}

    def execute(self,context):

        enum_prop = context.scene.set_enum_prop

        if enum_prop == '0':
            bpy.ops.mesh.primitive_cube_add()
        elif enum_prop == '1':
            bpy.ops.mesh.primitive_ico_sphere_add()
        elif enum_prop == '2':
            bpy.ops.mesh.primitive_cone_add()
        else:
            print ("None")

        return {"FINISHED"}

class whatever_panel(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_label = "Whatever Panel"

    @classmethod
    def poll(cls, context):
        return bpy.context.active_object != None and bpy.context.object.type == 'MESH'

    def draw(self, context):

        layout = self.layout
        layout.operator("object.set_enum_prop", "Add Mesh")
        layout.prop(context.scene, "set_enum_prop") 

#register

def register():
    bpy.utils.register_class(whatever_panel)
    bpy.utils.register_class(whatever_OP)
    bpy.types.Scene.set_enum_prop = EnumProperty \
        (
        items = Axis,
        name ="Add",
        description = "Set the Axis",
        #default = '2'
        )

def unregister():
    bpy.utils.unregister_class(whatever_panel)
    bpy.utils.unregister_class(whatever_OP)
    del bpy.types.Scene.set_enum_prop

if __name__ == "__main__":
    register()  

I don't know if you actually wanted the property on the object or the scene, as you used both(one pf the problems). So I just went with scene.

