It is intentional! This behavior is controlled with
bpy.ops.some_operator('INVOKE_DEFAULT')bpy.ops.some_operator('INVOKE_DEFAULT')
or
bpy.ops.some_operator('EXECUTE_DEFAULT')bpy.ops.some_operator('EXECUTE_DEFAULT')
and it's assumed that a script calls execute by default and a button calls invoke.
itIt is in the doc's but somewhat obfuscated.