Switching camera view on multiple cameras form python I've created 3 cameras in my scene and I need to go from the first to the last always in camera view.

What's wrong is that if I start my code in camera perspective, the camera changes and so do the view correctly.

But if i launch my code in user perspective, the cameras will switch correctly but the view not until the end, where it will go in the last camera's perspective

for w in bpy.context.window_manager.windows:
    s = w.screen
    for a in s:
        if a.type = 'VIEW_3D':
            for r in a.regions:
                if r.type='WINDOW':
                    override = {'window':w, 'screen':s, 'area':a, 'region':r}    

by.ops.view3d.viewnumpad(override, type='CAMERA')
for c in [c for c in bpy.context.scene.objects if c.type == 'CAMERA']:
    bpy.context.scene.camera = c
    bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations = 1)


Seems like the viewnumpad() is not triggering correctly the view before the switching. How can fix it?
The problem appears clearly when moving from any view to camera_view but it is also present when moving from camera_view to another (you can see that the view change from camera than hold still and then change at last) and it is caused by the ED_view3d_smooth_view_ex() ( source code ) function  and as you can see in the source code it is skipped if you are in render view , so for checking you can switch to render view and the code will run as expected 

here some code to make the transition clear (watch the view and console ) :

def main(context):
    print('******************************************************')
    bpy.ops.view3d.viewnumpad(type='CAMERA')
    bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations = 1)
    print('sleep')
    time.sleep(8)
    print('wake')




( it may have something to do with timers )